Provides lookup of ISO 3166-1 country data by alpha-2 code, alpha-3 code or locale. Built from a fixed, built-in list of countries (English and French short names, alpha-2 code, alpha-3 code and numeric code) loaded once when the instance is constructed. Used by templates and JS controllers that need to resolve or list countries, for example when rendering a country picker.


Properties

PropertyReturnsDescription
listList<CountryCode>The full list of known countries.

Methods

getFrom2Code(String alpha2Code)

Returns: CountryCode

Looks up a country by its ISO 3166-1 alpha-2 code.

ParameterDescription
alpha2Codethe two-letter country code, case-insensitive

getFrom3Code(String alpha3Code)

Returns: CountryCode

Looks up a country by its ISO 3166-1 alpha-3 code.

ParameterDescription
alpha3Codethe three-letter country code, case-insensitive

getFromLocale(Locale locale)

Returns: CountryCode

Looks up the country matching a locale's ISO 3166-1 alpha-3 country code.

ParameterDescription
localethe locale to resolve a country for

getList()

Returns: List<CountryCode>

The full list of known countries.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.