コード例 #1
0
  public int compareTo(DiscoveryDescription sd) throws ClassCastException {
    if (sd == null) {
      throw new NullPointerException();
    }
    if (sd == this) {
      return 0;
    }

    return getInstanceName().compareTo(sd.getInstanceName());
  }
コード例 #2
0
 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());
 }