コード例 #1
0
  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (!(o instanceof ContactConsumer3)) return false;

    ContactConsumer3 that = (ContactConsumer3) o;

    if (contact != null ? !contact.equals(that.contact) : that.contact != null) return false;
    if (location != null ? !location.equals(that.location) : that.location != null) return false;

    return true;
  }
コード例 #2
0
 @Override
 public int hashCode() {
   int result = contact != null ? contact.hashCode() : 0;
   result = 31 * result + (location != null ? location.hashCode() : 0);
   return result;
 }