@Test public void testEquals() { IpLink l1 = new IpLink(Ip.parse("1.1.1.2"), Ip.parse("1.1.1.3")); IpLink l2 = new IpLink(Ip.parse("1.1.1.3"), Ip.parse("1.1.1.4")); new EqualsTester() .addEqualityGroup(new OspfSessionProperties(0, l1), new OspfSessionProperties(0, l1)) .addEqualityGroup(new OspfSessionProperties(0, l2)) .addEqualityGroup(new OspfSessionProperties(1, l1)) .addEqualityGroup(new Object()) .testEquals(); }
@Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof OspfSessionProperties)) { return false; } OspfSessionProperties that = (OspfSessionProperties) o; return _area == that._area && Objects.equals(_ipLink, that._ipLink); }
OspfSessionProperties { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof OspfSessionProperties)) { return false; } OspfSessionProperties that = (OspfSessionProperties) o; return _area == that._area && Objects.equals(_ipLink, that._ipLink); } }
OspfSessionProperties { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof OspfSessionProperties)) { return false; } OspfSessionProperties that = (OspfSessionProperties) o; return _area == that._area && Objects.equals(_ipLink, that._ipLink); } OspfSessionProperties(long area, @Nullable IpLink ipLink); }
OspfSessionProperties { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof OspfSessionProperties)) { return false; } OspfSessionProperties that = (OspfSessionProperties) o; return _area == that._area && Objects.equals(_ipLink, that._ipLink); } OspfSessionProperties(long area, @Nullable IpLink ipLink); @JsonProperty(PROP_AREA) long getArea(); @JsonProperty(PROP_IP_LINK) @Nullable IpLink getIpLink(); @Override boolean equals(@Nullable Object o); @Override int hashCode(); @Override String toString(); }
OspfSessionProperties { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof OspfSessionProperties)) { return false; } OspfSessionProperties that = (OspfSessionProperties) o; return _area == that._area && Objects.equals(_ipLink, that._ipLink); } OspfSessionProperties(long area, @Nullable IpLink ipLink); @JsonProperty(PROP_AREA) long getArea(); @JsonProperty(PROP_IP_LINK) @Nullable IpLink getIpLink(); @Override boolean equals(@Nullable Object o); @Override int hashCode(); @Override String toString();  }