public int compareTo(DiscoveryDescription sd) throws ClassCastException { if (sd == null) { throw new NullPointerException(); } if (sd == this) { return 0; } return getInstanceName().compareTo(sd.getInstanceName()); }
public boolean equals(Object o) { if (o == this) { return true; } if (!(o instanceof DiscoveryDescription)) { return false; } DiscoveryDescription descriptor = (DiscoveryDescription) o; return descriptor.getInstanceName().equals(getInstanceName()); }