예제 #1
0
 @Override
 public int hashCode() {
   int result = firstName != null ? firstName.hashCode() : 0;
   result = 31 * result + (family != null ? family.hashCode() : 0);
   result = 31 * result + (birthDate != null ? birthDate.hashCode() : 0);
   result = 31 * result + (address != null ? address.hashCode() : 0);
   result = 31 * result + (checked ? 1 : 0);
   result = 31 * result + id;
   result = 31 * result + version;
   return result;
 }
예제 #2
0
  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    Person person = (Person) o;

    if (checked != person.checked) return false;
    if (id != person.id) return false;
    if (version != person.version) return false;
    if (address != null ? !address.equals(person.address) : person.address != null) return false;
    if (birthDate != null ? !birthDate.equals(person.birthDate) : person.birthDate != null)
      return false;
    if (family != null ? !family.equals(person.family) : person.family != null) return false;
    if (firstName != null ? !firstName.equals(person.firstName) : person.firstName != null)
      return false;

    return true;
  }