public final class MonetaryCurrencies
extends java.lang.Object
CurrencyUnit
instances as provided by the
different registered CurrencyProviderSpi
instances.
This class is thread safe.
Modifier and Type | Method and Description |
---|---|
static CurrencyUnit |
getCurrency(java.util.Locale locale)
Access a new instance based on the
Locale . |
static CurrencyUnit |
getCurrency(java.lang.String currencyCode)
Access a new instance based on the currency code.
|
static boolean |
isCurrencyAvailable(java.util.Locale locale)
Allows to check if a
CurrencyUnit instance is
defined, i.e. accessible from getCurrency(String) . |
static boolean |
isCurrencyAvailable(java.lang.String code)
Allows to check if a
CurrencyUnit instance is defined, i.e. |
public static CurrencyUnit getCurrency(java.util.Locale locale)
Locale
. Currencies are
available as provided by CurrencyProviderSpi
instances registered
with the Bootstrap
.locale
- the target Locale
, typically representing an ISO
country, not null
.CurrencyUnit
instance.UnknownCurrencyException
- if no such currency exists.public static CurrencyUnit getCurrency(java.lang.String currencyCode)
CurrencyProviderSpi
instances registered
with the Bootstrap
.currencyCode
- the ISO currency code, not null
.CurrencyUnit
instance.UnknownCurrencyException
- if no such currency exists.public static boolean isCurrencyAvailable(java.util.Locale locale)
CurrencyUnit
instance is
defined, i.e. accessible from getCurrency(String)
.locale
- the target Locale
, not null
.true
if getCurrency(Locale)
would return a
result for the given code.public static boolean isCurrencyAvailable(java.lang.String code)
CurrencyUnit
instance is defined, i.e.
accessible from getCurrency(String)
.code
- the currency code, not null
.true
if getCurrency(String)
would return a result for the given code.