@Test public void testEquals() { ConcreteInterfaceAddress cia = ConcreteInterfaceAddress.parse("1.1.1.1/24"); new EqualsTester() .addEqualityGroup(cia, cia, ConcreteInterfaceAddress.parse("1.1.1.1/24")) .addEqualityGroup(ConcreteInterfaceAddress.parse("1.1.1.2/24")) .addEqualityGroup(ConcreteInterfaceAddress.parse("1.1.1.1/23")) .addEqualityGroup(new Object()) .testEquals(); }
@Override public boolean equals(@Nullable Object o) { if (o == this) { return true; } else if (!(o instanceof ConcreteInterfaceAddress)) { return false; } ConcreteInterfaceAddress rhs = (ConcreteInterfaceAddress) o; return _ip.equals(rhs._ip) && _networkBits == rhs._networkBits; }
ConcreteInterfaceAddress extends InterfaceAddress { @Override public boolean equals(@Nullable Object o) { if (o == this) { return true; } else if (!(o instanceof ConcreteInterfaceAddress)) { return false; } ConcreteInterfaceAddress rhs = (ConcreteInterfaceAddress) o; return _ip.equals(rhs._ip) && _networkBits == rhs._networkBits; } }
ConcreteInterfaceAddress extends InterfaceAddress { @Override public boolean equals(@Nullable Object o) { if (o == this) { return true; } else if (!(o instanceof ConcreteInterfaceAddress)) { return false; } ConcreteInterfaceAddress rhs = (ConcreteInterfaceAddress) o; return _ip.equals(rhs._ip) && _networkBits == rhs._networkBits; } private  ConcreteInterfaceAddress(Ip ip, int networkBits); }
ConcreteInterfaceAddress extends InterfaceAddress { @Override public boolean equals(@Nullable Object o) { if (o == this) { return true; } else if (!(o instanceof ConcreteInterfaceAddress)) { return false; } ConcreteInterfaceAddress rhs = (ConcreteInterfaceAddress) o; return _ip.equals(rhs._ip) && _networkBits == rhs._networkBits; } private  ConcreteInterfaceAddress(Ip ip, int networkBits); static ConcreteInterfaceAddress create(Ip ip, int networkBits); static ConcreteInterfaceAddress create(Ip ip, Ip networkMask); static ConcreteInterfaceAddress parse(String text); @Override int compareTo(InterfaceAddress rhs); @Override boolean equals(@Nullable Object o); @Nonnull Ip getIp(); int getNetworkBits(); @Nonnull Prefix getPrefix(); @Override int hashCode(); @Override @JsonValue String toString(); }
ConcreteInterfaceAddress extends InterfaceAddress { @Override public boolean equals(@Nullable Object o) { if (o == this) { return true; } else if (!(o instanceof ConcreteInterfaceAddress)) { return false; } ConcreteInterfaceAddress rhs = (ConcreteInterfaceAddress) o; return _ip.equals(rhs._ip) && _networkBits == rhs._networkBits; } private  ConcreteInterfaceAddress(Ip ip, int networkBits); static ConcreteInterfaceAddress create(Ip ip, int networkBits); static ConcreteInterfaceAddress create(Ip ip, Ip networkMask); static ConcreteInterfaceAddress parse(String text); @Override int compareTo(InterfaceAddress rhs); @Override boolean equals(@Nullable Object o); @Nonnull Ip getIp(); int getNetworkBits(); @Nonnull Prefix getPrefix(); @Override int hashCode(); @Override @JsonValue String toString();  }