]> git.mxchange.org Git - jcustomer-core.git/blobdiff - src/org/mxchange/jcustomercore/model/customer/ContactCustomer.java
Continued:
[jcustomer-core.git] / src / org / mxchange / jcustomercore / model / customer / ContactCustomer.java
index 04daa5d7799caa4f619fab50b9f083bc1c2a5b9a..81f12fa7abfc8a24e0ccb72d2b6a0e71d77cc5b9 100644 (file)
@@ -39,6 +39,7 @@ import javax.persistence.Transient;
 import org.apache.commons.lang3.StringUtils;
 import org.mxchange.jcontacts.model.contact.Contact;
 import org.mxchange.jcontacts.model.contact.UserContact;
+import org.mxchange.jcontacts.model.utils.ContactUtils;
 import org.mxchange.jcoreutils.Comparables;
 import org.mxchange.jcustomercore.model.customer.status.CustomerAccountStatus;
 
@@ -168,8 +169,8 @@ public class ContactCustomer implements Customer {
                // Check parameter on null-reference and equality to this
                if (null == customer) {
                        // Should not happen
-                       throw new NullPointerException("customer is null"); //NOI18N
-               } else if (customer.equals(this)) {
+                       throw new NullPointerException("Parameter 'customer' is null"); //NOI18N
+               } else if (Objects.equals(this, customer)) {
                        // Same object
                        return 0;
                }
@@ -177,9 +178,9 @@ public class ContactCustomer implements Customer {
                // Init comparators
                final int comparators[] = {
                        // First check contact instance
-                       this.getCustomerContact().compareTo(customer.getCustomerContact()),
+                       ContactUtils.compare(this.getCustomerContact(), customer.getCustomerContact()),
                        // ... then customer number
-                       this.getCustomerNumber().compareTo(customer.getCustomerNumber()),
+                       StringUtils.compare(this.getCustomerNumber(), customer.getCustomerNumber()),
                        // ... last is confirmation key
                        StringUtils.compare(this.getCustomerConfirmKey(), customer.getCustomerConfirmKey())
                };