throw new NullPointerException("branchOffice1 is null"); //NOI18N
} else if (null == branchOffice2) {
// Second is null
- return -1;
+ return 1;
}
// Invoke compareTo() method
import org.mxchange.jcontactsbusiness.model.opening_time.BusinessOpeningTime;
import org.mxchange.jcontactsbusiness.model.opening_time.OpeningTime;
import org.mxchange.jcoreee.utils.Comparables;
+import org.mxchange.jcoreee.utils.NumberUtils;
import org.mxchange.jcoreee.utils.StringUtils;
import org.mxchange.jcountry.model.data.Country;
import org.mxchange.jcountry.model.data.CountryData;
// Init comparisons
final int[] comparators = {
// A different branch number is a clear indication ...
- Long.compare(this.getBranchNumber(), branchOffice.getBranchNumber()),
+ NumberUtils.compare(this.getBranchNumber(), branchOffice.getBranchNumber()),
// ... same with id ...
- Long.compare(this.getBranchId(), branchOffice.getBranchId()),
+ NumberUtils.compare(this.getBranchId(), branchOffice.getBranchId()),
// ... then country
this.getBranchCountry().compareTo(branchOffice.getBranchCountry()),
// ... next city
// ... and house number
this.getBranchHouseNumber().compareTo(branchOffice.getBranchHouseNumber()),
// ... and house number
- Short.compare(this.getBranchLastHouseNumber(), branchOffice.getBranchLastHouseNumber()),
+ NumberUtils.compare(this.getBranchLastHouseNumber(), branchOffice.getBranchLastHouseNumber()),
// ... and extension
StringUtils.compareToIgnoreCase(this.getBranchHouseNumberExtension(), branchOffice.getBranchHouseNumberExtension()),
// ... store ...
- Short.compare(this.getBranchStore(), branchOffice.getBranchStore()),
+ NumberUtils.compare(this.getBranchStore(), branchOffice.getBranchStore()),
// ... suite number ...
- Short.compare(this.getBranchSuiteNumber(), branchOffice.getBranchSuiteNumber())
+ NumberUtils.compare(this.getBranchSuiteNumber(), branchOffice.getBranchSuiteNumber())
};
// Check all values
throw new NullPointerException("department1 is null"); //NOI18N
} else if (null == department2) {
// Second is null
- return -1;
+ return 1;
}
// Invoke compareTo() method
import org.mxchange.jcontactsbusiness.model.opening_time.BusinessOpeningTime;
import org.mxchange.jcontactsbusiness.model.opening_time.OpeningTime;
import org.mxchange.jcoreee.utils.Comparables;
+import org.mxchange.jcoreee.utils.NumberUtils;
import org.mxchange.jcoreee.utils.StringUtils;
import org.mxchange.jcountry.model.data.Country;
import org.mxchange.jcountry.model.data.CountryData;
// ... next country
this.getHeadquarterCountry().compareTo(headquarter.getHeadquarterCountry()),
// ... then ZIP code
- Integer.compare(this.getHeadquarterZipCode(), headquarter.getHeadquarterZipCode()),
+ NumberUtils.compare(this.getHeadquarterZipCode(), headquarter.getHeadquarterZipCode()),
// ... and city
this.getHeadquarterCity().compareTo(headquarter.getHeadquarterCity()),
// ... street name
StringUtils.compareToIgnoreCase(this.getHeadquarterStreet(), headquarter.getHeadquarterStreet()),
// ... house number
- Integer.compare(this.getHeadquarterHouseNumber(), headquarter.getHeadquarterHouseNumber()),
+ NumberUtils.compare(this.getHeadquarterHouseNumber(), headquarter.getHeadquarterHouseNumber()),
// ... last house number
- Integer.compare(this.getHeadquarterLastHouseNumber(), headquarter.getHeadquarterLastHouseNumber()),
+ NumberUtils.compare(this.getHeadquarterLastHouseNumber(), headquarter.getHeadquarterLastHouseNumber()),
// ... extension
StringUtils.compareToIgnoreCase(this.getHeadquarterHouseNumberExtension(), headquarter.getHeadquarterHouseNumberExtension()),
// ... store number
- Integer.compare(this.getHeadquarterStore(), headquarter.getHeadquarterStore()),
+ NumberUtils.compare(this.getHeadquarterStore(), headquarter.getHeadquarterStore()),
// ... suite number
- Integer.compare(this.getHeadquarterSuiteNumber(), headquarter.getHeadquarterSuiteNumber()),
+ NumberUtils.compare(this.getHeadquarterSuiteNumber(), headquarter.getHeadquarterSuiteNumber()),
// ... last email address
StringUtils.compareToIgnoreCase(this.getHeadquarterEmailAddress(), headquarter.getHeadquarterEmailAddress())
};
throw new NullPointerException("headquarter1 is null"); //NOI18N
} else if (null == headquarter2) {
// Second headquarter is null
- return -1;
+ return 1;
}
// Now that both are not NULL, compare them
throw new NullPointerException("jobPosition1 is null"); //NOI18N
} else if (null == jobPosition2) {
// Second is null
- return -1;
+ return 1;
}
// Invoke compareTo() method