Esempio n. 1
0
 @Override
 public int hashCode() {
   final int prime = 31;
   int result = 1;
   result = prime * result + ((colFamily == null) ? 0 : colFamily.hashCode());
   result = prime * result + ((key == null) ? 0 : key.hashCode());
   return result;
 }
Esempio n. 2
0
 @Override
 public boolean equals(Object obj) {
   if (this == obj) return true;
   if (obj == null) return false;
   if (getClass() != obj.getClass()) return false;
   TheKey other = (TheKey) obj;
   if (colFamily == null) {
     if (other.colFamily != null) return false;
   } else if (!colFamily.equals(other.colFamily)) return false;
   if (key == null) {
     if (other.key != null) return false;
   } else if (!key.equals(other.key)) return false;
   return true;
 }
Esempio n. 3
0
  @Override
  public int compare(ByteArray o1, ByteArray o2) {
    if (o1.getKey() == null && o2.getKey() != null) return -1;
    else if (o2.getKey() == null && o1.getKey() != null) return 1;
    else if (o2.getKey() == null && o1.getKey() == null) return 0;

    String left = StandardConverters.convertFromBytes(String.class, o1.getKey());
    String right = StandardConverters.convertFromBytes(String.class, o2.getKey());
    return left.compareTo(right);
  }