Пример #1
0
 @Override
 public Region getRegion(RegionType type, String code) {
   if (!"ISO".equals(type.getId())) {
     return null;
   }
   return this.regions.get(code);
 }
Пример #2
0
 @Override
 public Collection<Region> getRegions(RegionType type) {
   if (!"ISO".equals(type.getId())) {
     return Collections.emptySet();
   }
   return Collections.unmodifiableCollection(regions.values());
 }
Пример #3
0
 private void reload() {
   regionTypes.clear();
   RegionType rt = RegionType.of("ISO");
   regionTypes.add(rt);
   for (String country : Locale.getISOCountries()) {
     Locale locale = new Locale("", country);
     ISOCountry region = new ISOCountry(locale, rt);
     regions.put(region.getRegionCode(), region);
     ISO3Country region3 = new ISO3Country(locale, rt);
     regions.put(region.getISO3Code(), region3);
   }
 }