]> git.mxchange.org Git - juser-core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sun, 23 Oct 2022 16:33:17 +0000 (18:33 +0200)
committerRoland Häder <roland@mxchange.org>
Sun, 23 Oct 2022 16:33:17 +0000 (18:33 +0200)
- compare more than just user name and contact instance so it can be sorted by
  them as well

src/org/mxchange/jusercore/model/user/LoginUser.java

index a8caa50bed9d3877fd98b2c64587a91536ecd3b3..9a3b346d43684b9db7b67dc33e9072083eb3eea9 100644 (file)
@@ -231,8 +231,16 @@ public class LoginUser implements User {
                final int comparitors[] = {
                        // First contact
                        ContactUtils.compare(this.getUserContact(), user.getUserContact()),
-                       // ... then user name
-                       this.getUserName().compareTo(user.getUserName())
+                       // ... then user name (case-insensitive)
+                       this.getUserName().compareToIgnoreCase(user.getUserName()),
+                       // ... account status
+                       this.getUserAccountStatus().compareTo(user.getUserAccountStatus()),
+                       // ... profile mode
+                       this.getUserProfileMode().compareTo(user.getUserProfileMode()),
+                       // ... "must change password" flag
+                       this.getUserMustChangePassword().compareTo(user.getUserMustChangePassword()),
+                       // ... confirm key
+                       this.getUserConfirmKey().compareTo(user.getUserConfirmKey())
                };
 
                // Check all values