]> git.mxchange.org Git - jcontacts-core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sun, 26 Apr 2020 17:22:56 +0000 (19:22 +0200)
committerRoland Häder <roland@mxchange.org>
Sun, 26 Apr 2020 17:22:56 +0000 (19:22 +0200)
- need to compare all entity properties in equals()/hashCode() methods

Signed-off-by: Roland Häder <roland@mxchange.org>
src/org/mxchange/jcontacts/model/contact/UserContact.java

index 3015382921f91550f989f39152d6cf83843b726b..0bc9850da0acc77a6d8cdd9bb475e62f5ce61b5e 100644 (file)
@@ -317,27 +317,41 @@ public class UserContact implements Contact {
 
                final Contact other = (Contact) object;
 
-               if (!Objects.equals(this.getContactCity(), other.getContactCity())) {
+               if (!Objects.equals(this.getContactBirthday(), other.getContactBirthday())) {
+                       return false;
+               } else if (!Objects.equals(this.getContactCity(), other.getContactCity())) {
+                       return false;
+               } else if (!Objects.equals(this.getContactComment(), other.getContactCountry())) {
+                       return false;
+               } else if (!Objects.equals(this.getContactCountry(), other.getContactCountry())) {
                        return false;
                } else if (!Objects.equals(this.getContactEmailAddress(), other.getContactEmailAddress())) {
                        return false;
                } else if (!Objects.equals(this.getContactFamilyName(), other.getContactFamilyName())) {
                        return false;
+               } else if (!Objects.equals(this.getContactFaxNumber(), other.getContactFaxNumber())) {
+                       return false;
                } else if (!Objects.equals(this.getContactFirstName(), other.getContactFirstName())) {
                        return false;
-               } else if (!Objects.equals(this.getContactStreet(), other.getContactStreet())) {
+               } else if (!Objects.equals(this.getContactHouseNumber(), other.getContactHouseNumber())) {
                        return false;
-               } else if (!Objects.equals(this.getContactTitle(), other.getContactTitle())) {
+               } else if (!Objects.equals(this.getContactHouseNumberExtension(), other.getContactHouseNumberExtension())) {
                        return false;
-               } else if (!Objects.equals(this.getContactBirthday(), other.getContactBirthday())) {
+               } else if (!Objects.equals(this.getContactId(), other.getContactId())) {
                        return false;
-               } else if (!Objects.equals(this.getContactCountry(), other.getContactCountry())) {
+               } else if (!Objects.equals(this.getContactLandLineNumber(), other.getContactLandLineNumber())) {
+                       return false;
+               } else if (!Objects.equals(this.getContactMobileNumber(), other.getContactMobileNumber())) {
                        return false;
                } else if (this.getContactPersonalTitle() != other.getContactPersonalTitle()) {
                        return false;
-               } else if (!Objects.equals(this.getContactHouseNumber(), other.getContactHouseNumber())) {
+               } else if (!Objects.equals(this.getContactStreet(), other.getContactStreet())) {
                        return false;
-               } else if (!Objects.equals(this.getContactHouseNumberExtension(), other.getContactHouseNumberExtension())) {
+               } else if (!Objects.equals(this.getContactTitle(), other.getContactTitle())) {
+                       return false;
+               } else if (!Objects.equals(this.getContactZipCode(), other.getContactZipCode())) {
+                       return false;
+               } else if (!Objects.equals(this.isOwnContact(), other.isOwnContact())) {
                        return false;
                }
 
@@ -552,15 +566,22 @@ public class UserContact implements Contact {
 
                hash = 29 * hash + Objects.hashCode(this.getContactBirthday());
                hash = 29 * hash + Objects.hashCode(this.getContactCity());
+               hash = 29 * hash + Objects.hashCode(this.getContactComment());
                hash = 29 * hash + Objects.hashCode(this.getContactCountry());
                hash = 29 * hash + Objects.hashCode(this.getContactEmailAddress());
                hash = 29 * hash + Objects.hashCode(this.getContactFamilyName());
+               hash = 29 * hash + Objects.hashCode(this.getContactFaxNumber());
                hash = 29 * hash + Objects.hashCode(this.getContactFirstName());
-               hash = 29 * hash + Objects.hashCode(this.getContactPersonalTitle());
                hash = 29 * hash + Objects.hashCode(this.getContactHouseNumber());
                hash = 29 * hash + Objects.hashCode(this.getContactHouseNumberExtension());
+               hash = 29 * hash + Objects.hashCode(this.getContactId());
+               hash = 29 * hash + Objects.hashCode(this.getContactLandLineNumber());
+               hash = 29 * hash + Objects.hashCode(this.getContactMobileNumber());
+               hash = 29 * hash + Objects.hashCode(this.getContactPersonalTitle());
                hash = 29 * hash + Objects.hashCode(this.getContactStreet());
                hash = 29 * hash + Objects.hashCode(this.getContactTitle());
+               hash = 29 * hash + Objects.hashCode(this.getContactZipCode());
+               hash = 29 * hash + Objects.hashCode(this.isOwnContact());
 
                return hash;
        }