public final class IsoUtils extends Object
Currency
and Locale
API.
The list of valid currency and country codes can be manipulated after initialization in order to change or add new values. This can be particularly helpful when the application is not running on the latest Java version and a currency change or addition has not yet been updated in the used JRE.
Modifier and Type | Method and Description |
---|---|
Set<String> |
getCountries() |
Set<String> |
getCurrencies() |
static IsoUtils |
getInstance() |
boolean |
isValidISOCountry(String countryCode)
Checks if the country code is a valid ISO country using Java
Locale.getISOCountries() |
boolean |
isValidISOCurrency(String currencyCode)
Checks if the currency code is a valid ISO currency using Java
Currency |
void |
setCountries(Set<String> countries) |
void |
setCurrencies(Set<String> currencies) |
public static IsoUtils getInstance()
public boolean isValidISOCurrency(String currencyCode)
Currency
currencyCode
- a three letters capitalized currency code, example: USDpublic boolean isValidISOCountry(String countryCode)
Locale.getISOCountries()
countryCode
- a two letters capitalized country code, example: US