return false;
}
- final BranchOffice other = (BranchOffice) object;
+ final BranchOffice branchOffice = (BranchOffice) object;
- if (!Objects.equals(this.getBranchId(), other.getBranchId())) {
+ if (!Objects.equals(this.getBranchId(), branchOffice.getBranchId())) {
return false;
- } else if (!Objects.equals(this.getBranchCity(), other.getBranchCity())) {
+ } else if (!Objects.equals(this.getBranchCity(), branchOffice.getBranchCity())) {
return false;
- } else if (!Objects.equals(this.getBranchCountry(), other.getBranchCountry())) {
+ } else if (!Objects.equals(this.getBranchCountry(), branchOffice.getBranchCountry())) {
return false;
- } else if (!Objects.equals(this.getBranchHouseNumber(), other.getBranchHouseNumber())) {
+ } else if (!Objects.equals(this.getBranchHouseNumber(), branchOffice.getBranchHouseNumber())) {
return false;
- } else if (!Objects.equals(this.getBranchNumber(), other.getBranchNumber())) {
+ } else if (!Objects.equals(this.getBranchHouseNumberExtension(), branchOffice.getBranchHouseNumberExtension())) {
return false;
- } else if (!Objects.equals(this.getBranchStore(), other.getBranchStore())) {
+ } else if (!Objects.equals(this.getBranchLastHouseNumber(), branchOffice.getBranchLastHouseNumber())) {
return false;
- } else if (!Objects.equals(this.getBranchStreet(), other.getBranchStreet())) {
+ } else if (!Objects.equals(this.getBranchNumber(), branchOffice.getBranchNumber())) {
return false;
- } else if (!Objects.equals(this.getBranchSuiteNumber(), other.getBranchSuiteNumber())) {
+ } else if (!Objects.equals(this.getBranchStore(), branchOffice.getBranchStore())) {
return false;
- } else if (!Objects.equals(this.getBranchZipCode(), other.getBranchZipCode())) {
+ } else if (!Objects.equals(this.getBranchStreet(), branchOffice.getBranchStreet())) {
+ return false;
+ } else if (!Objects.equals(this.getBranchSuiteNumber(), branchOffice.getBranchSuiteNumber())) {
+ return false;
+ } else if (!Objects.equals(this.getBranchZipCode(), branchOffice.getBranchZipCode())) {
return false;
}
hash = 53 * hash + Objects.hashCode(this.getBranchCountry());
hash = 53 * hash + Objects.hashCode(this.getBranchNumber());
hash = 53 * hash + Objects.hashCode(this.getBranchHouseNumber());
+ hash = 53 * hash + Objects.hashCode(this.getBranchHouseNumberExtension());
+ hash = 53 * hash + Objects.hashCode(this.getBranchLastHouseNumber());
hash = 53 * hash + Objects.hashCode(this.getBranchStore());
hash = 53 * hash + Objects.hashCode(this.getBranchStreet());
hash = 53 * hash + Objects.hashCode(this.getBranchSuiteNumber());
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
+import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData;
import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
import org.mxchange.jcontactsbusiness.model.branchoffice.BusinessBranchOffice;
import org.mxchange.jcontactsbusiness.model.employee.BusinessEmployee;
+import org.mxchange.jcontactsbusiness.model.employee.Employable;
import org.mxchange.jcontactsbusiness.model.headquarter.BusinessHeadquarter;
+import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter;
import org.mxchange.jusercore.model.user.LoginUser;
import org.mxchange.jusercore.model.user.User;
-import org.mxchange.jcontactsbusiness.model.employee.Employable;
-import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
-import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter;
/**
* A POJO for company departments
package org.mxchange.jcontactsbusiness.model.department;
import java.io.Serializable;
+import java.text.MessageFormat;
import java.util.Objects;
+import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
+import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter;
/**
* Utilities class for departments
} else if (department1.getDepartmentCompany() == null) {
// Throw NPE again
throw new NullPointerException("department1.departmentCompany is null"); //NOI18N
+ } else if (department1.getDepartmentCompany().getBasicDataId() == null) {
+ // Throw NPE again
+ throw new NullPointerException("department1.departmentCompany.basicDataId is null"); //NOI18N
+ } else if (department1.getDepartmentCompany().getBasicDataId() < 1) {
+ // Throw NPE again
+ throw new NullPointerException(MessageFormat.format("department1.departmentCompany.basicDataId={0} is valid.", department1.getDepartmentCompany().getBasicDataId())); //NOI18N
} else if (department1.getDepartmentI18nKey() == null) {
// Throw it again
throw new NullPointerException("department1.departmentName is null"); //NOI18N
} else if (department2.getDepartmentCompany() == null) {
// Throw NPE again
throw new NullPointerException("department2.departmentCompany is null"); //NOI18N
+ } else if (department2.getDepartmentCompany().getBasicDataId() == null) {
+ // Throw NPE again
+ throw new NullPointerException("department2.departmentCompany.basicDataId is null"); //NOI18N
+ } else if (department2.getDepartmentCompany().getBasicDataId() < 1) {
+ // Throw NPE again
+ throw new NullPointerException(MessageFormat.format("department2.departmentCompany.basicDataId={0} is valid.", department2.getDepartmentCompany().getBasicDataId())); //NOI18N
} else if (department2.getDepartmentI18nKey() == null) {
// Throw it again
throw new NullPointerException("department2.departmentName is null"); //NOI18N
// Same company and same name?
boolean isSame = ((Objects.equals(department1.getDepartmentCompany(), department2.getDepartmentCompany())) &&
+ (((department1.getDepartmentBranchOffice() instanceof BranchOffice) &&
+ (Objects.equals(department1.getDepartmentBranchOffice(), department2.getDepartmentBranchOffice()))) ||
+ ((department1.getDepartmentHeadquarter() instanceof Headquarter) &&
+ (Objects.equals(department1.getDepartmentHeadquarter(), department2.getDepartmentHeadquarter())))) &&
(Objects.equals(department1.getDepartmentI18nKey(), department2.getDepartmentI18nKey())));
// Return it