@Test public void testEquals() { Ip ip = Ip.parse("169.254.0.1"); Ip ip2 = Ip.parse("169.254.0.2"); LinkLocalAddress lla = LinkLocalAddress.of(ip); new EqualsTester() .addEqualityGroup(lla, lla, LinkLocalAddress.of(ip)) .addEqualityGroup(LinkLocalAddress.of(ip2)) .addEqualityGroup(new Object()) .testEquals(); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof LinkLocalAddress)) { return false; } LinkLocalAddress that = (LinkLocalAddress) o; return _ip.equals(that._ip); }
LinkLocalAddress extends InterfaceAddress { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof LinkLocalAddress)) { return false; } LinkLocalAddress that = (LinkLocalAddress) o; return _ip.equals(that._ip); } }
LinkLocalAddress extends InterfaceAddress { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof LinkLocalAddress)) { return false; } LinkLocalAddress that = (LinkLocalAddress) o; return _ip.equals(that._ip); } private  LinkLocalAddress(Ip ip); }
LinkLocalAddress extends InterfaceAddress { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof LinkLocalAddress)) { return false; } LinkLocalAddress that = (LinkLocalAddress) o; return _ip.equals(that._ip); } private  LinkLocalAddress(Ip ip); static LinkLocalAddress of(Ip ip); @Nonnull Ip getIp(); Prefix getPrefix(); @Override boolean equals(Object o); @Override int hashCode(); @Override @JsonValue String toString(); static LinkLocalAddress parse(String text); @Override int compareTo(InterfaceAddress o); }
LinkLocalAddress extends InterfaceAddress { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof LinkLocalAddress)) { return false; } LinkLocalAddress that = (LinkLocalAddress) o; return _ip.equals(that._ip); } private  LinkLocalAddress(Ip ip); static LinkLocalAddress of(Ip ip); @Nonnull Ip getIp(); Prefix getPrefix(); @Override boolean equals(Object o); @Override int hashCode(); @Override @JsonValue String toString(); static LinkLocalAddress parse(String text); @Override int compareTo(InterfaceAddress o);  }