@Test public void testEquals() { IeeeAddress address1 = new IeeeAddress("17880100dc880b"); IeeeAddress address2 = new IeeeAddress("17880100dc880b"); assertTrue(address1.equals(address2)); }
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (!IeeeAddress.class.isAssignableFrom(obj.getClass())) { return false; } final IeeeAddress other = (IeeeAddress) obj; for (int cnt = 0; cnt < 8; cnt++) { if (other.getValue()[cnt] != address[cnt]) { return false; } } return true; }
IeeeAddress implements Comparable<IeeeAddress> { @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (!IeeeAddress.class.isAssignableFrom(obj.getClass())) { return false; } final IeeeAddress other = (IeeeAddress) obj; for (int cnt = 0; cnt < 8; cnt++) { if (other.getValue()[cnt] != address[cnt]) { return false; } } return true; } }
IeeeAddress implements Comparable<IeeeAddress> { @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (!IeeeAddress.class.isAssignableFrom(obj.getClass())) { return false; } final IeeeAddress other = (IeeeAddress) obj; for (int cnt = 0; cnt < 8; cnt++) { if (other.getValue()[cnt] != address[cnt]) { return false; } } return true; } IeeeAddress();  IeeeAddress(BigInteger address);  IeeeAddress(String address);  IeeeAddress(int[] address); }
IeeeAddress implements Comparable<IeeeAddress> { @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (!IeeeAddress.class.isAssignableFrom(obj.getClass())) { return false; } final IeeeAddress other = (IeeeAddress) obj; for (int cnt = 0; cnt < 8; cnt++) { if (other.getValue()[cnt] != address[cnt]) { return false; } } return true; } IeeeAddress();  IeeeAddress(BigInteger address);  IeeeAddress(String address);  IeeeAddress(int[] address); int[] getValue(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); @Override int compareTo(IeeeAddress other); }
IeeeAddress implements Comparable<IeeeAddress> { @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (!IeeeAddress.class.isAssignableFrom(obj.getClass())) { return false; } final IeeeAddress other = (IeeeAddress) obj; for (int cnt = 0; cnt < 8; cnt++) { if (other.getValue()[cnt] != address[cnt]) { return false; } } return true; } IeeeAddress();  IeeeAddress(BigInteger address);  IeeeAddress(String address);  IeeeAddress(int[] address); int[] getValue(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); @Override int compareTo(IeeeAddress other);  }