@Test public final void testEquals() { new EqualsTester() .addEqualityGroup(new DeviceFragmentId(DID1, PID), new DeviceFragmentId(DID1, PID)) .addEqualityGroup(new DeviceFragmentId(DID2, PID), new DeviceFragmentId(DID2, PID)) .addEqualityGroup(new DeviceFragmentId(DID1, PIDA), new DeviceFragmentId(DID1, PIDA)) .addEqualityGroup(new DeviceFragmentId(DID2, PIDA), new DeviceFragmentId(DID2, PIDA)) .testEquals(); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof DeviceFragmentId)) { return false; } DeviceFragmentId that = (DeviceFragmentId) obj; return Objects.equals(this.deviceId, that.deviceId) && Objects.equals(this.providerId, that.providerId); }
DeviceFragmentId { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof DeviceFragmentId)) { return false; } DeviceFragmentId that = (DeviceFragmentId) obj; return Objects.equals(this.deviceId, that.deviceId) && Objects.equals(this.providerId, that.providerId); } }
DeviceFragmentId { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof DeviceFragmentId)) { return false; } DeviceFragmentId that = (DeviceFragmentId) obj; return Objects.equals(this.deviceId, that.deviceId) && Objects.equals(this.providerId, that.providerId); } DeviceFragmentId(DeviceId deviceId, ProviderId providerId); @SuppressWarnings("unused") private  DeviceFragmentId(); }
DeviceFragmentId { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof DeviceFragmentId)) { return false; } DeviceFragmentId that = (DeviceFragmentId) obj; return Objects.equals(this.deviceId, that.deviceId) && Objects.equals(this.providerId, that.providerId); } DeviceFragmentId(DeviceId deviceId, ProviderId providerId); @SuppressWarnings("unused") private  DeviceFragmentId(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); }
DeviceFragmentId { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof DeviceFragmentId)) { return false; } DeviceFragmentId that = (DeviceFragmentId) obj; return Objects.equals(this.deviceId, that.deviceId) && Objects.equals(this.providerId, that.providerId); } DeviceFragmentId(DeviceId deviceId, ProviderId providerId); @SuppressWarnings("unused") private  DeviceFragmentId(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); final ProviderId providerId; final DeviceId deviceId; }