@Test public void testEquals() { IpLink link1 = new IpLink(Ip.ZERO, Ip.ZERO); IpLink link2 = new IpLink(Ip.ZERO, Ip.FIRST_CLASS_A_PRIVATE_IP); IpLink link3 = new IpLink(Ip.FIRST_CLASS_B_PRIVATE_IP, Ip.FIRST_CLASS_A_PRIVATE_IP); new EqualsTester() .addEqualityGroup(new Object()) .addEqualityGroup(link1, link1, new IpLink(Ip.ZERO, Ip.ZERO)) .addEqualityGroup(link2) .addEqualityGroup(link3) .testEquals(); }
@Override public boolean equals(Object o) { if (o == this) { return true; } else if (!(o instanceof IpLink)) { return false; } IpLink other = (IpLink) o; return _ip1.equals(other._ip1) && _ip2.equals(other._ip2); }
IpLink implements Comparable<IpLink> { @Override public boolean equals(Object o) { if (o == this) { return true; } else if (!(o instanceof IpLink)) { return false; } IpLink other = (IpLink) o; return _ip1.equals(other._ip1) && _ip2.equals(other._ip2); } }
IpLink implements Comparable<IpLink> { @Override public boolean equals(Object o) { if (o == this) { return true; } else if (!(o instanceof IpLink)) { return false; } IpLink other = (IpLink) o; return _ip1.equals(other._ip1) && _ip2.equals(other._ip2); } IpLink(@Nonnull Ip ip1, @Nonnull Ip ip2); }
IpLink implements Comparable<IpLink> { @Override public boolean equals(Object o) { if (o == this) { return true; } else if (!(o instanceof IpLink)) { return false; } IpLink other = (IpLink) o; return _ip1.equals(other._ip1) && _ip2.equals(other._ip2); } IpLink(@Nonnull Ip ip1, @Nonnull Ip ip2); @JsonProperty(PROP_IP1) @Nonnull Ip getIp1(); @JsonProperty(PROP_IP2) @Nonnull Ip getIp2(); @Override int compareTo(@Nonnull IpLink other); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
IpLink implements Comparable<IpLink> { @Override public boolean equals(Object o) { if (o == this) { return true; } else if (!(o instanceof IpLink)) { return false; } IpLink other = (IpLink) o; return _ip1.equals(other._ip1) && _ip2.equals(other._ip2); } IpLink(@Nonnull Ip ip1, @Nonnull Ip ip2); @JsonProperty(PROP_IP1) @Nonnull Ip getIp1(); @JsonProperty(PROP_IP2) @Nonnull Ip getIp2(); @Override int compareTo(@Nonnull IpLink other); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }