/** * @see Object#equals(Object) */ @Override public boolean equals(Object other) { if (other == this) { return true; } if (!(other instanceof HostAddress)) { return false; } HostAddress that = (HostAddress) other; return getAddrType() == that.getAddrType() && Arrays.equals(getAddress(), that.getAddress()); }
/** * @see Object#equals(Object) */ @Override public boolean equals(Object other) { if (other == this) { return true; } if (!(other instanceof HostAddress)) { return false; } HostAddress that = (HostAddress) other; return getAddrType() == that.getAddrType() && Arrays.equals(getAddress(), that.getAddress()); }
/** * @see Object#hashCode() */ @Override public int hashCode() { int hash = 17 + getAddrType().getValue() * 31; if (getAddress() != null) { hash = 31 * hash + Arrays.hashCode(getAddress()); } return hash; } }
/** * @see Object#hashCode() */ @Override public int hashCode() { int hash = 17 + getAddrType().getValue() * 31; if (getAddress() != null) { hash = 31 * hash + Arrays.hashCode(getAddress()); } return hash; } }
public void writeAddress(HostAddress address) throws IOException { write(address.getAddrType().getValue()); write(address.getAddress().length); write(address.getAddress(), 0, address.getAddress().length); }
public void writeAddress(HostAddress address) throws IOException { write(address.getAddrType().getValue()); write(address.getAddress().length); write(address.getAddress(), 0, address.getAddress().length); }