From: Roland Häder Date: Fri, 7 Oct 2022 18:08:17 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=780f58f7486222abb5149e1dde895fe876c78f06;p=jaddressbook-core.git Continued: - use utility classes instead --- 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