if (null == basicData) {
// Should not happen
throw new NullPointerException("basicData is null"); //NOI18N
- } else if (basicData.equals(this)) {
+ } else if (Objects.equals(this, basicData)) {
// Same object
return 0;
}
import org.mxchange.jcoreutils.SafeNumberUtils;
import org.mxchange.jcountry.model.data.Country;
import org.mxchange.jcountry.model.data.CountryData;
+import org.mxchange.jcountry.model.utils.CountryUtils;
import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
import org.mxchange.jphone.model.phonenumbers.fax.FaxNumber;
import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
if (null == branchOffice) {
// Should not happen
throw new NullPointerException("branchOffice is null"); //NOI18N
- } else if (branchOffice.equals(this)) {
+ } else if (Objects.equals(this, branchOffice)) {
// Same object
return 0;
}
// Init comparisons
final int[] comparators = {
- // First compare basic data
// First compare basic data
this.getBranchCompany().compareTo(branchOffice.getBranchCompany()),
// ... branch office number
// ... contact person
ContactUtils.compare(this.getBranchContactEmployee(), branchOffice.getBranchContactEmployee()),
// ... then country
- this.getBranchCountry().compareTo(branchOffice.getBranchCountry()),
+ CountryUtils.compare(this.getBranchCountry(), branchOffice.getBranchCountry()),
// ... next city
this.getBranchCity().compareToIgnoreCase(branchOffice.getBranchCity()),
// ... then ZIP code
import org.mxchange.jcoreutils.SafeNumberUtils;
import org.mxchange.jcountry.model.data.Country;
import org.mxchange.jcountry.model.data.CountryData;
+import org.mxchange.jcountry.model.utils.CountryUtils;
import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
import org.mxchange.jphone.model.phonenumbers.fax.FaxNumber;
import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
if (null == headquarter) {
// Should not happen
throw new NullPointerException("headquarter is null"); //NOI18N
- } else if (headquarter.equals(this)) {
+ } else if (Objects.equals(this, headquarter)) {
// Same object
return 0;
}
// First check company name
this.getHeadquarterCompanyName().compareTo(headquarter.getHeadquarterCompanyName()),
// ... next country
- this.getHeadquarterCountry().compareTo(headquarter.getHeadquarterCountry()),
+ CountryUtils.compare(this.getHeadquarterCountry(), headquarter.getHeadquarterCountry()),
// ... then ZIP code
SafeNumberUtils.compare(this.getHeadquarterZipCode(), headquarter.getHeadquarterZipCode()),
// ... and city
if (null == logo) {
// Should not happen
throw new NullPointerException("logo is null"); //NOI18N
- } else if (logo.equals(this)) {
+ } else if (Objects.equals(this, logo)) {
// Same object
return 0;
}
if (null == openingTime) {
// Should not happen
throw new NullPointerException("openingTime is null"); //NOI18N
- } else if (openingTime.equals(this)) {
+ } else if (Objects.equals(this, openingTime)) {
// Same object
return 0;
}