public void createCountry() { Country country = new CountryImpl(); country.setAbbreviation("US"); country.setName("United States"); countryService.save(country); ISOCountry isoCountry = new ISOCountryImpl(); isoCountry.setAlpha2("US"); isoCountry.setName("UNITED STATES"); isoService.save(isoCountry); }
/** * Returns the taxAmount for the passed in country or * null if no match is found. * * First checks the abbreviation (uppercase) followed by the name (uppercase). * * @param countryTaxRateMap, country * @return */ public Double lookupCountryRate(Map<String,Double> countryTaxRateMap, Country country) { if (countryTaxRateMap != null && country != null && country.getAbbreviation() != null) { String cntryAbbr = country.getAbbreviation().toUpperCase(); Double rate = countryTaxRateMap.get(cntryAbbr); if (rate == null && country.getName() != null) { String countryName = country.getName().toUpperCase(); return countryTaxRateMap.get(countryName); } else { return rate; } } return null; }
myRealm.beginTransaction(); // Create an object Country country1 = myRealm.createObject(Country.class); country1.setName("Norway"); country1.setPopulation(5165800); country1.setCode("NO"); myRealm.commitTransaction();
} else if (fgAddress.getCountry() != null) { countryAbbr = fgAddress.getCountry().getAbbreviation();
} else if (billAddress.getCountry() != null) { countryAbbr = billAddress.getCountry().getAbbreviation();
private Address buildAddress() { Address address = new AddressImpl(); address.setAddressLine1("123 Test Rd"); address.setCity("Dallas"); address.setFirstName("Jeff"); address.setLastName("Fischer"); address.setPostalCode("75240"); address.setPrimaryPhone("972-978-9067"); State state = new StateImpl(); state.setAbbreviation("ALL"); state.setName("ALL"); address.setState(state); Country country = new CountryImpl(); country.setAbbreviation("US"); country.setName("United States"); state.setCountry(country); address.setCountry(country); ISOCountry isoCountry = new ISOCountryImpl(); isoCountry.setAlpha2("US"); isoCountry.setName("UNITED STATES"); address.setIsoCountryAlpha2(isoCountry); return address; } }
address.setPrimaryPhone("972-978-9067"); Country country = new CountryImpl(); country.setAbbreviation("US"); country.setName("United States");
country.setAbbreviation("US"); country.setName("United States");
country.setAbbreviation("US"); country.setName("United States"); country2.setAbbreviation("US"); country2.setName("United States");
country.setAbbreviation("US"); country.setName("United States"); country2.setAbbreviation("US"); country2.setName("United States");
country.setAbbreviation("US"); country.setName("United States");