]> git.mxchange.org Git - jcontacts-business-core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sun, 25 Mar 2018 13:38:04 +0000 (15:38 +0200)
committerRoland Häder <roland@mxchange.org>
Sun, 25 Mar 2018 15:47:50 +0000 (17:47 +0200)
- need to sort by employee's number, then contact data, then email address
  and then the rest from narrower to wide data

Signed-off-by: Roland Häder <roland@mxchange.org>
src/org/mxchange/jcontactsbusiness/model/employee/BusinessEmployee.java

index 4d4da0a4a6c862afbada818c24aa4e48ecb0656b..aaed9867f1ffa9a98f4c5b6e03d894c882eb83c1 100644 (file)
@@ -213,22 +213,22 @@ public class BusinessEmployee implements Employable {
 
                // Init comparisons
                final int[] comparators = {
-                       // First check company data (BasicData)
-                       this.getEmployeeBasicData().compareTo(employable.getEmployeeBasicData()),
-                       // ... next headquarters
-                       Headquarters.compare(this.getEmployeeHeadquarter(), employable.getEmployeeHeadquarter()),
-                       // ... branch office
-                       BranchOffices.compare(this.getEmployeeBranchOffice(), employable.getEmployeeBranchOffice()),
-                       // ... department
-                       Departments.compare(this.getEmployeeDepartment(), employable.getEmployeeDepartment()),
-                       // ... job position
-                       JobPositions.compare(this.getEmployeeJobPosition(), employable.getEmployeeJobPosition()),
-                       // ... employee's number
+                       // First employee's number
                        StringUtils.compareIgnoreCase(this.getEmployeeNumber(), employable.getEmployeeNumber()),
+                       // ... finally contact data
+                       Contacts.compare(this.getEmployeePersonalData(), employable.getEmployeePersonalData()),
                        // ... employee's email address
                        StringUtils.compareIgnoreCase(this.getEmployeeEmailAddress(), employable.getEmployeeEmailAddress()),
-                       // ... finally contact data
-                       Contacts.compare(this.getEmployeePersonalData(), employable.getEmployeePersonalData())
+                       // ... company data (BasicData)
+                       this.getEmployeeBasicData().compareTo(employable.getEmployeeBasicData()),
+                       // ... job position
+                       JobPositions.compare(this.getEmployeeJobPosition(), employable.getEmployeeJobPosition()),
+                       // ... department
+                       Departments.compare(this.getEmployeeDepartment(), employable.getEmployeeDepartment()),
+                       // ... branch office
+                       BranchOffices.compare(this.getEmployeeBranchOffice(), employable.getEmployeeBranchOffice()),
+                       // ... next headquarters
+                       Headquarters.compare(this.getEmployeeHeadquarter(), employable.getEmployeeHeadquarter()),
                };
 
                // Check all values