예제 #1
0
 public int compareTo(RdnEntry that) {
   int diff = type.compareToIgnoreCase(that.type);
   if (diff != 0) {
     return diff;
   }
   if (value.equals(that.value)) { // try shortcut
     return 0;
   }
   return getValueComparable().compareTo(that.getValueComparable());
 }
예제 #2
0
    public boolean equals(Object obj) {
      if (obj == this) {
        return true;
      }
      if (!(obj instanceof RdnEntry)) {
        return false;
      }

      // Any change here must be reflected in hashCode()
      RdnEntry that = (RdnEntry) obj;
      return (type.equalsIgnoreCase(that.type))
          && (getValueComparable().equals(that.getValueComparable()));
    }