]> git.mxchange.org Git - jaddressbook-core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Fri, 7 Oct 2022 18:08:17 +0000 (20:08 +0200)
committerRoland Häder <roland@mxchange.org>
Fri, 7 Oct 2022 18:08:17 +0000 (20:08 +0200)
- use utility classes instead

src/org/mxchange/jaddressbook/model/addressbook/UserAddressbook.java
src/org/mxchange/jaddressbook/model/addressbook/entry/UserAddressbookEntry.java

index e6099743238645ad7d3e7281828b1bb94ace6217..7ee57628a6b57753f21b2d7cf1e68bd50a9731a6 100644 (file)
@@ -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
index f101b09ea6b1fc1f553d9834643940cd37d7b640..3701f489ce00a7dd2c1fd211a51f1e7e51056466 100644 (file)
@@ -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