Modifier and Type | Method and Description |
---|---|
static String |
getCountryCodeAlpha3(String alpha2CountryCode)
Returns the CountryCode (3166-1 alpha3 format) based on the given alpha2 country code or null if it does not
exist.
|
static Locale |
getCountryLocale(String isoCountryCode)
Returns the Country Locale based on the given ISO alpha2 or alpha3 country code or null if it does not exist.
|
static Map<String,Locale> |
getIsoAlpha2ToCountryLocales()
Returns the Map of ISO Alpha2 country codes to corresponding Java Locales.
|
static Map<String,Locale> |
getIsoAlpha3ToCountryLocales()
Returns the Map of ISO Alpha3 country codes to corresponding Java Locales.
|
static boolean |
hasCountryCodeAlpha3(String alpha3CountryCode)
Returns
true only if the given alpha3 country code exists, returns false otherwise. |
static boolean |
isValidIsoCountryCode(String isoCountryCode)
Returns
true only if the given ISO alpha2 or alpha3 country code exists, returns false
otherwise. |
public static String getCountryCodeAlpha3(String alpha2CountryCode) throws MissingResourceException
alpha2CountryCode
- The alpha2 Country code to search.MissingResourceException
- Throws MissingResourceException if the three-letter country abbreviation is not
available for this countryCode.public static Locale getCountryLocale(String isoCountryCode) throws MissingResourceException
isoCountryCode
- The ISO alpha2 or alpha3 Country code to search.MissingResourceException
- Throws MissingResourceException if the three-letter country abbreviation is not
available for this countryCode.public static Map<String,Locale> getIsoAlpha2ToCountryLocales()
public static Map<String,Locale> getIsoAlpha3ToCountryLocales()
public static boolean hasCountryCodeAlpha3(@Nullable String alpha3CountryCode)
true
only if the given alpha3 country code exists, returns false
otherwise.alpha3CountryCode
- The alpha3 Country code to check.true
if the alpha3 CountryCode exists, false
otherwise.public static boolean isValidIsoCountryCode(@Nullable String isoCountryCode)
true
only if the given ISO alpha2 or alpha3 country code exists, returns false
otherwise.isoCountryCode
- The ISO alpha2 or alpha3 Country code to check.true
if the isoCountryCode exists, false
otherwise.Copyright © 2020. All Rights Reserved.