From 780f58f7486222abb5149e1dde895fe876c78f06 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 7 Oct 2022 20:08:17 +0200 Subject: [PATCH] Continued: - use utility classes instead --- .../jaddressbook/model/addressbook/UserAddressbook.java | 3 ++- .../model/addressbook/entry/UserAddressbookEntry.java | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/org/mxchange/jaddressbook/model/addressbook/UserAddressbook.java b/src/org/mxchange/jaddressbook/model/addressbook/UserAddressbook.java index e609974..7ee5762 100644 --- a/src/org/mxchange/jaddressbook/model/addressbook/UserAddressbook.java +++ b/src/org/mxchange/jaddressbook/model/addressbook/UserAddressbook.java @@ -40,6 +40,7 @@ import org.mxchange.jaddressbook.model.addressbook.status.AddressbokStatus; import org.mxchange.jcoreutils.comparable.Comparables; import org.mxchange.jusercore.model.user.LoginUser; import org.mxchange.jusercore.model.user.User; +import org.mxchange.jusercore.model.utils.UserUtils; /** * A POJO for user address books @@ -162,7 +163,7 @@ public class UserAddressbook implements Addressbook { // ... status this.getAddressbookStatus().compareTo(addressbook.getAddressbookStatus()), // .. then user - this.getAddressbookUser().compareTo(addressbook.getAddressbookUser()) + UserUtils.compare(this.getAddressbookUser(), addressbook.getAddressbookUser()) }; // Check all values diff --git a/src/org/mxchange/jaddressbook/model/addressbook/entry/UserAddressbookEntry.java b/src/org/mxchange/jaddressbook/model/addressbook/entry/UserAddressbookEntry.java index f101b09..3701f48 100644 --- a/src/org/mxchange/jaddressbook/model/addressbook/entry/UserAddressbookEntry.java +++ b/src/org/mxchange/jaddressbook/model/addressbook/entry/UserAddressbookEntry.java @@ -37,8 +37,10 @@ import org.mxchange.jaddressbook.model.addressbook.Addressbook; import org.mxchange.jaddressbook.model.addressbook.UserAddressbook; import org.mxchange.jcontacts.model.contact.Contact; import org.mxchange.jcontacts.model.contact.UserContact; +import org.mxchange.jcontacts.model.utils.ContactUtils; import org.mxchange.jcontactsbusiness.model.basicdata.BasicData; import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData; +import org.mxchange.jcontactsbusiness.model.utils.BasicDataUtils; import org.mxchange.jcoreutils.comparable.Comparables; /** @@ -122,9 +124,9 @@ public class UserAddressbookEntry implements AddressbookEntry { // First compare address books this.getEntryAddressbook().compareTo(addressbookEntry.getEntryAddressbook()), // ... then business address - this.getAddressbookEntryBusinessBasicData().compareTo(addressbookEntry.getAddressbookEntryBusinessBasicData()), + BasicDataUtils.compare(this.getAddressbookEntryBusinessBasicData(), addressbookEntry.getAddressbookEntryBusinessBasicData()), // ... then private contact - this.getAddressbookEntryPrivateContact().compareTo(addressbookEntry.getAddressbookEntryPrivateContact()) + ContactUtils.compare(this.getAddressbookEntryPrivateContact(), addressbookEntry.getAddressbookEntryPrivateContact()) }; // Check all vaules -- 2.39.5