protected boolean addressesContentsAreEqual(Address address1, Address address2) { return address1 != null && address2 != null && Objects.equals(address2.getAddressLine1(), address1.getAddressLine1()) && Objects.equals(address2.getAddressLine2(), address1.getAddressLine2()) && Objects.equals(address2.getCity(), address1.getCity()) && Objects.equals(address2.getStateProvinceRegion(), address1.getStateProvinceRegion()) && Objects.equals(address2.getPostalCode(), address1.getPostalCode()) && Objects.equals(address2.getIsoCountryAlpha2(), address1.getIsoCountryAlpha2()) && Objects.equals(address2.getIsoCountrySubdivision(), address1.getIsoCountrySubdivision()); } }
@Override public void populateAddressISOCountrySub(Address address) { if (StringUtils.isBlank(address.getIsoCountrySubdivision()) && address.getIsoCountryAlpha2() != null && StringUtils.isNotBlank(address.getStateProvinceRegion())) { String friendlyStateProvRegion = address.getStateProvinceRegion(); CountrySubdivision isoCountrySub = countrySubdivisionService.findSubdivisionByCountryAndAltAbbreviation(address.getIsoCountryAlpha2().getAlpha2(), friendlyStateProvRegion); if (isoCountrySub == null) { isoCountrySub = countrySubdivisionService.findSubdivisionByCountryAndName(address.getIsoCountryAlpha2().getAlpha2(), friendlyStateProvRegion); } if (isoCountrySub != null) { address.setIsoCountrySubdivision(isoCountrySub.getAbbreviation()); } } }
if (StringUtils.isNotBlank(address.getStateProvinceRegion())) { stateCodeRate = lookupStateRate(itemStateTaxRateMap, address.getStateProvinceRegion()); } else { stateCodeRate = lookupStateRate(itemStateTaxRateMap, address.getState());
if (StringUtils.isNotBlank(address.getStateProvinceRegion())) { stateCodeRate = lookupStateRate(fulfillmentGroupStateTaxRateMap, address.getStateProvinceRegion()); } else { stateCodeRate = lookupStateRate(fulfillmentGroupStateTaxRateMap, address.getState());
if (StringUtils.isNotBlank(address.getStateProvinceRegion())) { state = address.getStateProvinceRegion(); } else if (address.getState() != null) { state = address.getState().getAbbreviation();
String phone = null; if (StringUtils.isNotBlank(fgAddress.getStateProvinceRegion())) { stateAbbr = fgAddress.getStateProvinceRegion(); } else if (fgAddress.getState() != null) {
String phone = null; if (StringUtils.isNotBlank(billAddress.getStateProvinceRegion())) { stateAbbr = billAddress.getStateProvinceRegion(); } else if (billAddress.getState() != null) {
dest.setCounty(orig.getCounty()); dest.setIsoCountrySubdivision(orig.getIsoCountrySubdivision()); dest.setStateProvinceRegion(orig.getStateProvinceRegion()); dest.setPostalCode(orig.getPostalCode()); dest.setZipFour(orig.getZipFour());