@Test public void testEquals() { assertTrue(new IPv6("ffff::ffff").equals(new IPv6("ffff:0000::0000:ffff"))); assertFalse(new IPv6("1234::5678").equals(new IPv6("ffff:0000::0000:ffff"))); }
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final IPv6 that = (IPv6) obj; String thisIp; String thatIp; try { thisIp = this.ip == null ? null : this.expand(); } catch (IPStringConversionException ex) { thisIp = this.ip; } try { thatIp = that.ip == null ? null : that.expand(); } catch (IPStringConversionException ex) { thatIp = that.ip; } if ((thisIp == null) ? (thatIp != null) : !thisIp.equals(thatIp)) { return false; } return true; }
IPv6 implements Comparable<IPv6> { @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final IPv6 that = (IPv6) obj; String thisIp; String thatIp; try { thisIp = this.ip == null ? null : this.expand(); } catch (IPStringConversionException ex) { thisIp = this.ip; } try { thatIp = that.ip == null ? null : that.expand(); } catch (IPStringConversionException ex) { thatIp = that.ip; } if ((thisIp == null) ? (thatIp != null) : !thisIp.equals(thatIp)) { return false; } return true; } }
IPv6 implements Comparable<IPv6> { @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final IPv6 that = (IPv6) obj; String thisIp; String thatIp; try { thisIp = this.ip == null ? null : this.expand(); } catch (IPStringConversionException ex) { thisIp = this.ip; } try { thatIp = that.ip == null ? null : that.expand(); } catch (IPStringConversionException ex) { thatIp = that.ip; } if ((thisIp == null) ? (thatIp != null) : !thisIp.equals(thatIp)) { return false; } return true; } IPv6(BigInteger in);  IPv6();  IPv6(String ip);  IPv6(byte[] in); }
IPv6 implements Comparable<IPv6> { @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final IPv6 that = (IPv6) obj; String thisIp; String thatIp; try { thisIp = this.ip == null ? null : this.expand(); } catch (IPStringConversionException ex) { thisIp = this.ip; } try { thatIp = that.ip == null ? null : that.expand(); } catch (IPStringConversionException ex) { thatIp = that.ip; } if ((thisIp == null) ? (thatIp != null) : !thisIp.equals(thatIp)) { return false; } return true; } IPv6(BigInteger in);  IPv6();  IPv6(String ip);  IPv6(byte[] in); static String expand(String ipStr, int nwords); String expand(); BigInteger toBigInteger(); static IPv6 bigInteger2IPv6(BigInteger in); static byte[] IpString2bytes(String ipStr); static String bytes2IpString(byte[] in); void setIp(byte[] in); String getString(); byte[] getBytes(); void setIp(String ip); void insertInteger(int in, int startBit); void insertBigInteger(BigInteger in, int startBit, int size); void setAccountPartition(int accountId); void setVipOctets(int lo); int getVipOctets(); void setClusterPartition(IPv6Cidr clusterCidr); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); @Override int compareTo(IPv6 that); }
IPv6 implements Comparable<IPv6> { @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final IPv6 that = (IPv6) obj; String thisIp; String thatIp; try { thisIp = this.ip == null ? null : this.expand(); } catch (IPStringConversionException ex) { thisIp = this.ip; } try { thatIp = that.ip == null ? null : that.expand(); } catch (IPStringConversionException ex) { thatIp = that.ip; } if ((thisIp == null) ? (thatIp != null) : !thisIp.equals(thatIp)) { return false; } return true; } IPv6(BigInteger in);  IPv6();  IPv6(String ip);  IPv6(byte[] in); static String expand(String ipStr, int nwords); String expand(); BigInteger toBigInteger(); static IPv6 bigInteger2IPv6(BigInteger in); static byte[] IpString2bytes(String ipStr); static String bytes2IpString(byte[] in); void setIp(byte[] in); String getString(); byte[] getBytes(); void setIp(String ip); void insertInteger(int in, int startBit); void insertBigInteger(BigInteger in, int startBit, int size); void setAccountPartition(int accountId); void setVipOctets(int lo); int getVipOctets(); void setClusterPartition(IPv6Cidr clusterCidr); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); @Override int compareTo(IPv6 that);  }