Exemplo n.º 1
0
 @Override
 public int hashCode() {
   final int prime = 31;
   int result = 1;
   result = prime * result + ((value == null) ? 0 : value.hashCode());
   return result;
 }
Exemplo n.º 2
0
 @Override
 public boolean sameAs(LeadershipToken o) {
   if ((o == null) || (o.getClass() != this.getClass())) {
     return false;
   }
   PaxosValue v = ((PaxosLeadershipToken) o).value;
   if (value == v) {
     return true;
   }
   return value != null
       && v != null
       && (new CompareToBuilder()
               .append(value.getLeaderUUID(), v.getLeaderUUID())
               .append(value.getRound(), v.getRound())
               .append(value.getData(), v.getData())
               .toComparison()
           == 0);
 }
Exemplo n.º 3
0
 @Override
 public boolean equals(Object obj) {
   if (this == obj) {
     return true;
   }
   if (obj == null) {
     return false;
   }
   if (getClass() != obj.getClass()) {
     return false;
   }
   PaxosLeadershipToken other = (PaxosLeadershipToken) obj;
   if (value == null) {
     if (other.value != null) {
       return false;
     }
   } else if (!value.equals(other.value)) {
     return false;
   }
   return true;
 }