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