public abstract class BaseMonetaryCurrenciesSingletonSpi extends Object implements MonetaryCurrenciesSingletonSpi
Monetary that provides access to
different registered CurrencyProviderSpi instances.
Implementations of this interface must be thread safe.| Constructor and Description |
|---|
BaseMonetaryCurrenciesSingletonSpi() |
| Modifier and Type | Method and Description |
|---|---|
Set<CurrencyUnit> |
getCurrencies(Locale locale,
String... providers)
Provide access to all currently known currencies.
|
Set<CurrencyUnit> |
getCurrencies(String... providers)
Provide access to all currently known currencies.
|
CurrencyUnit |
getCurrency(CurrencyQuery query)
Access a single currency by query.
|
CurrencyUnit |
getCurrency(Locale country,
String... providers)
Access a new instance based on the currency code.
|
CurrencyUnit |
getCurrency(String currencyCode,
String... providers)
Access a new instance based on the currency code.
|
boolean |
isCurrencyAvailable(Locale locale,
String... providers)
Allows to check if a
CurrencyUnit instance is
defined, i.e. |
boolean |
isCurrencyAvailable(String code,
String... providers)
Allows to check if a
CurrencyUnit instance is defined, i.e. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCurrencies, getDefaultProviderChain, getProviderNamespublic BaseMonetaryCurrenciesSingletonSpi()
public CurrencyUnit getCurrency(String currencyCode, String... providers)
CurrencyProviderSpi instances registered
with the Bootstrap.getCurrency in interface MonetaryCurrenciesSingletonSpicurrencyCode - the ISO currency code, not null.providers - the (optional) specification of providers to consider. If not set (empty) the providers
as defined by #getDefaultRoundingProviderChain() should be used.CurrencyUnit instance.UnknownCurrencyException - if no such currency exists.public CurrencyUnit getCurrency(Locale country, String... providers)
CurrencyProviderSpi instances registered
with the Bootstrap.getCurrency in interface MonetaryCurrenciesSingletonSpicountry - the ISO currency's country, not null.providers - the (optional) specification of providers to consider. If not set (empty) the providers
as defined by #getDefaultRoundingProviderChain() should be used.CurrencyUnit instance.UnknownCurrencyException - if no such currency exists.public Set<CurrencyUnit> getCurrencies(Locale locale, String... providers)
getCurrencies in interface MonetaryCurrenciesSingletonSpilocale - the target Locale, typically representing an ISO country,
not null.providers - the (optional) specification of providers to consider. If not set (empty) the providers
as defined by #getDefaultRoundingProviderChain() should be used.public boolean isCurrencyAvailable(String code, String... providers)
CurrencyUnit instance is defined, i.e.
accessible from getCurrency(String, String...).isCurrencyAvailable in interface MonetaryCurrenciesSingletonSpicode - the currency code, not null.providers - the (optional) specification of providers to consider. If not set (empty) the providers
as defined by #getDefaultRoundingProviderChain() should be used.true if getCurrency(String, String...)
would return a result for the given code.public boolean isCurrencyAvailable(Locale locale, String... providers)
CurrencyUnit instance is
defined, i.e. accessible from getCurrency(String, String...).isCurrencyAvailable in interface MonetaryCurrenciesSingletonSpilocale - the target Locale, not null.providers - the (optional) specification of providers to consider. If not set (empty) the providers
as defined by #getDefaultRoundingProviderChain() should be used.true if getCurrencies(java.util.Locale, String...) would return a
non empty result for the given code.public Set<CurrencyUnit> getCurrencies(String... providers)
getCurrencies in interface MonetaryCurrenciesSingletonSpiproviders - the (optional) specification of providers to consider. If not set (empty) the providers
as defined by #getDefaultRoundingProviderChain() should be used.public CurrencyUnit getCurrency(CurrencyQuery query)
getCurrency in interface MonetaryCurrenciesSingletonSpiquery - The currency query, not null.CurrencyUnit found, never null.MonetaryException - if multiple currencies match the query.Copyright © 2012–2020 JavaMoney. All rights reserved.