]> git.mxchange.org Git - jcontacts-business-core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sat, 9 May 2020 23:47:53 +0000 (01:47 +0200)
committerRoland Häder <roland@mxchange.org>
Sat, 9 May 2020 23:53:57 +0000 (01:53 +0200)
- renamed other to fooEntity
- renamed logoUploader to logoUploaderUser
- added missing members to equals()/hashCode()
- sorted members in equals()/hashCode() methods

Signed-off-by: Roland Häder <roland@mxchange.org>
src/org/mxchange/jcontactsbusiness/model/basicdata/BusinessBasicData.java
src/org/mxchange/jcontactsbusiness/model/department/BusinessDepartment.java
src/org/mxchange/jcontactsbusiness/model/jobposition/EmployeePosition.java
src/org/mxchange/jcontactsbusiness/model/logo/BusinessLogo.java
src/org/mxchange/jcontactsbusiness/model/logo/Logo.java

index f5a9f9d1c057e2ebe3152d69894f545285c75d53..469c915c9c234dbe5ee917da58056e41ef62c56c 100644 (file)
@@ -259,31 +259,31 @@ public class BusinessBasicData implements BasicData {
                        return false;
                }
 
-               final BasicData other = (BasicData) object;
+               final BasicData basicData = (BasicData) object;
 
-               if (!Objects.equals(this.getBasicDataId(), other.getBasicDataId())) {
+               if (!Objects.equals(this.getBasicDataId(), basicData.getBasicDataId())) {
                        return false;
-               } else if (!Objects.equals(this.getCompanyComments(), other.getCompanyComments())) {
+               } else if (!Objects.equals(this.getCompanyComments(), basicData.getCompanyComments())) {
                        return false;
-               } else if (!Objects.equals(this.getCompanyEmailAddress(), other.getCompanyEmailAddress())) {
+               } else if (!Objects.equals(this.getCompanyEmailAddress(), basicData.getCompanyEmailAddress())) {
                        return false;
-               } else if (!Objects.equals(this.getCompanyFaxNumber(), other.getCompanyFaxNumber())) {
+               } else if (!Objects.equals(this.getCompanyFaxNumber(), basicData.getCompanyFaxNumber())) {
                        return false;
-               } else if (!Objects.equals(this.getCompanyLandLineNumber(), other.getCompanyLandLineNumber())) {
+               } else if (!Objects.equals(this.getCompanyLandLineNumber(), basicData.getCompanyLandLineNumber())) {
                        return false;
-               } else if (!Objects.equals(this.getCompanyLogo(), other.getCompanyLogo())) {
+               } else if (!Objects.equals(this.getCompanyLogo(), basicData.getCompanyLogo())) {
                        return false;
-               } else if (!Objects.equals(this.getCompanyName(), other.getCompanyName())) {
+               } else if (!Objects.equals(this.getCompanyName(), basicData.getCompanyName())) {
                        return false;
-               } else if (!Objects.equals(this.getCompanyRoadNumber(), other.getCompanyRoadNumber())) {
+               } else if (!Objects.equals(this.getCompanyRoadNumber(), basicData.getCompanyRoadNumber())) {
                        return false;
-               } else if (!Objects.equals(this.getCompanyShortName(), other.getCompanyShortName())) {
+               } else if (!Objects.equals(this.getCompanyShortName(), basicData.getCompanyShortName())) {
                        return false;
-               } else if (!Objects.equals(this.getCompanyTaxNumber(), other.getCompanyTaxNumber())) {
+               } else if (!Objects.equals(this.getCompanyTaxNumber(), basicData.getCompanyTaxNumber())) {
                        return false;
-               } else if (!Objects.equals(this.getCompanyUserOwner(), other.getCompanyUserOwner())) {
+               } else if (!Objects.equals(this.getCompanyUserOwner(), basicData.getCompanyUserOwner())) {
                        return false;
-               } else if (!Objects.equals(this.getCompanyWebsiteUrl(), other.getCompanyWebsiteUrl())) {
+               } else if (!Objects.equals(this.getCompanyWebsiteUrl(), basicData.getCompanyWebsiteUrl())) {
                        return false;
                }
 
index 6428a13dd47959489e81162f38b180b90c43a55b..bc2dcb677377347ecff670204dc3b7d090e5c670 100644 (file)
@@ -205,13 +205,19 @@ public class BusinessDepartment implements Department {
                        return false;
                }
 
-               final Department other = (Department) object;
+               final Department department = (Department) object;
 
-               if (!Objects.equals(this.getDepartmentBranchOffice(), other.getDepartmentBranchOffice())) {
+               if (!Objects.equals(this.getDepartmentBranchOffice(), department.getDepartmentBranchOffice())) {
                        return false;
-               } else if (!Objects.equals(this.getDepartmentCompany(), other.getDepartmentCompany())) {
+               } else if (!Objects.equals(this.getDepartmentCompany(), department.getDepartmentCompany())) {
                        return false;
-               } else if (!Objects.equals(this.getDepartmentI18nKey(), other.getDepartmentI18nKey())) {
+               } else if (!Objects.equals(this.getDepartmentHeadquarter(), department.getDepartmentHeadquarter())) {
+                       return false;
+               } else if (!Objects.equals(this.getDepartmentI18nKey(), department.getDepartmentI18nKey())) {
+                       return false;
+               } else if (!Objects.equals(this.getDepartmentId(), department.getDepartmentId())) {
+                       return false;
+               } else if (!Objects.equals(this.getDepartmentUserOwner(), department.getDepartmentUserOwner())) {
                        return false;
                }
 
@@ -316,9 +322,12 @@ public class BusinessDepartment implements Department {
        public int hashCode () {
                int hash = 5;
 
-               hash = 53 * hash + Objects.hashCode(this.getDepartmentId());
+               hash = 53 * hash + Objects.hashCode(this.getDepartmentBranchOffice());
                hash = 53 * hash + Objects.hashCode(this.getDepartmentCompany());
+               hash = 53 * hash + Objects.hashCode(this.getDepartmentHeadquarter());
+               hash = 53 * hash + Objects.hashCode(this.getDepartmentId());
                hash = 53 * hash + Objects.hashCode(this.getDepartmentI18nKey());
+               hash = 53 * hash + Objects.hashCode(this.getDepartmentUserOwner());
 
                return hash;
        }
index 88de0ce9db3c28edd25fec15937296fd2b067471..fbb1d15eedfdce2acb332c349dad6affa88347b6 100644 (file)
@@ -166,15 +166,15 @@ public class EmployeePosition implements HireableJobPosition {
                        return false;
                }
 
-               final HireableJobPosition other = (HireableJobPosition) object;
+               final HireableJobPosition jobPosition = (HireableJobPosition) object;
 
-               if (!Objects.equals(this.getJobPositionAddedUser(), other.getJobPositionAddedUser())) {
+               if (!Objects.equals(this.getJobPositionAddedUser(), jobPosition.getJobPositionAddedUser())) {
                        return false;
-               } else if (!Objects.equals(this.getJobPositionId(), other.getJobPositionId())) {
+               } else if (!Objects.equals(this.getJobPositionId(), jobPosition.getJobPositionId())) {
                        return false;
-               } else if (!Objects.equals(this.getJobPositionName(), other.getJobPositionName())) {
+               } else if (!Objects.equals(this.getJobPositionName(), jobPosition.getJobPositionName())) {
                        return false;
-               } else if (!Objects.equals(this.getJobPositionStatus(), other.getJobPositionStatus())) {
+               } else if (!Objects.equals(this.getJobPositionStatus(), jobPosition.getJobPositionStatus())) {
                        return false;
                }
 
index 99a9ceb9de5a9c86d4583896cd71656491fe2fe7..32907e6aca3228a8064a2e5f844c86859d381aeb 100644 (file)
@@ -84,9 +84,9 @@ public class BusinessLogo implements Logo {
        /**
         * Logo uploader user instance
         */
-       @JoinColumn (name = "logo_uploader_id", nullable = false, updatable = false)
+       @JoinColumn (name = "logo_uploader_user_id", nullable = false, updatable = false)
        @OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.REFRESH, optional = false)
-       private User logoUploader;
+       private User logoUploaderUser;
 
        @Override
        public int compareTo (final Logo logo) {
@@ -104,7 +104,7 @@ public class BusinessLogo implements Logo {
                        // First file name ...
                        this.getLogoFileName().compareToIgnoreCase(logo.getLogoFileName()),
                        // ... then uploader instance
-                       this.getLogoUploader().compareTo(logo.getLogoUploader())
+                       this.getLogoUploaderUser().compareTo(logo.getLogoUploaderUser())
                };
 
                // Check all values
@@ -122,13 +122,13 @@ public class BusinessLogo implements Logo {
                        return false;
                }
 
-               final Logo other = (Logo) object;
+               final Logo logo = (Logo) object;
 
-               if (!Objects.equals(this.getLogoId(), other.getLogoId())) {
+               if (!Objects.equals(this.getLogoFileName(), logo.getLogoFileName())) {
                        return false;
-               } else if (!Objects.equals(this.getLogoUploader(), other.getLogoUploader())) {
+               } else if (!Objects.equals(this.getLogoId(), logo.getLogoId())) {
                        return false;
-               } else if (!Objects.equals(this.getLogoFileName(), other.getLogoFileName())) {
+               } else if (!Objects.equals(this.getLogoUploaderUser(), logo.getLogoUploaderUser())) {
                        return false;
                }
 
@@ -180,22 +180,22 @@ public class BusinessLogo implements Logo {
        }
 
        @Override
-       public User getLogoUploader () {
-               return this.logoUploader;
+       public User getLogoUploaderUser () {
+               return this.logoUploaderUser;
        }
 
        @Override
-       public void setLogoUploader (final User logoUploader) {
-               this.logoUploader = logoUploader;
+       public void setLogoUploaderUser (final User logoUploaderUser) {
+               this.logoUploaderUser = logoUploaderUser;
        }
 
        @Override
        public int hashCode () {
                int hash = 3;
 
-               hash = 53 * hash + Objects.hashCode(this.getLogoId());
                hash = 53 * hash + Objects.hashCode(this.getLogoFileName());
-               hash = 53 * hash + Objects.hashCode(this.getLogoUploader());
+               hash = 53 * hash + Objects.hashCode(this.getLogoId());
+               hash = 53 * hash + Objects.hashCode(this.getLogoUploaderUser());
 
                return hash;
        }
index ddfc9e37eb382da98b4c86c415f7b9fa0af5bec5..19c2d7bc5deaff7fdf9f71e699598963e33599b7 100644 (file)
@@ -60,14 +60,14 @@ public interface Logo extends Comparable<Logo>, Serializable {
         * <p>
         * @return User owner instance
         */
-       User getLogoUploader ();
+       User getLogoUploaderUser ();
 
        /**
         * Setter for user owner instance
         * <p>
         * @param logoUploader User owner instance
         */
-       void setLogoUploader (final User logoUploader);
+       void setLogoUploaderUser (final User logoUploader);
 
        /**
         * Getter for timestamp when this entry has been created