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;
// 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;
}
// 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())
};