javax.money.convert.ProviderContext.
Instances of this class must only provide conversion data for exact one provider, identified by
ProviderContext#getProviderName().
When accessing ExchangeRateProvider instances or javax.money.convert.CurrencyConversion instances from the
MonetaryConversions
in many cases a chain of providers will be returned. It is the responsibility of the implementation code assembling
the chain to
establish a well defined coordination mechanism for evaluating the correct result. By default the first provider
in the chain that returns a non null result determines the final result of a call. Nevertheless adapting the
javax.money.spi.MonetaryConversionsSingletonSpi allows
to implement also alternate strategies, e.g. honoring different priorities of providers as well.
Implementations of this interface are required to be thread save.
Implementations of this class must neither be immutable nor serializable.
| Modifier and Type | Method and Description |
|---|---|
| public ProviderContext | Returns: the exchange rate type, nevernull.Access the |
| public CurrencyConversion | getCurrencyConversion(ConversionQuery
the required conversionQuery)ConversionQuery, not nullAccess a |
| public default CurrencyConversion | getCurrencyConversion(CurrencyUnit
term term)CurrencyUnit, not nullAccess a |
| public default CurrencyConversion | getCurrencyConversion(String
terminal/target currency code, not termCode)nullAccess a |
| public ExchangeRate | Returns: the matchingExchangeRate.the required conversionQuery)ConversionQuery, not nullAccess a |
| public default ExchangeRate | Returns: the matchingExchangeRate.base base, CurrencyUnit CurrencyUnit, not nullterm term)CurrencyUnit, not nullAccess a |
| public default ExchangeRate | Returns: the matchingExchangeRate.base currency code, not baseCode, String nullterm/target currency code, not termCode)nullAccess a |
| public default ExchangeRate | getReversed(ExchangeRate
ExchangeRate, not nullThe method reverses the |
| public default boolean | isAvailable(ConversionQuery
the required conversionQuery)ConversionQuery, not nullChecks if an |
| public default boolean | isAvailable(CurrencyUnit
the base base, CurrencyUnit CurrencyUnitthe term term)CurrencyUnitChecks if an |
| public default boolean | isAvailable(String
the base currency code baseCode, String the terminal/target currency code termCode)Checks if an |
| getContext | back to summary |
|---|---|
| public ProviderContext getContext() Access the
| |
| getCurrencyConversion | back to summary |
|---|---|
| public CurrencyConversion getCurrencyConversion(ConversionQuery conversionQuery) Access a
| |
| getCurrencyConversion | back to summary |
|---|---|
| public default CurrencyConversion getCurrencyConversion(CurrencyUnit term) Access a
| |
| getCurrencyConversion | back to summary |
|---|---|
| public default CurrencyConversion getCurrencyConversion(String termCode) Access a
| |
| getExchangeRate | back to summary |
|---|---|
| public ExchangeRate getExchangeRate(ConversionQuery conversionQuery) Access a
| |
| getExchangeRate | back to summary |
|---|---|
| public default ExchangeRate getExchangeRate(CurrencyUnit base, CurrencyUnit term) Access a
| |
| getExchangeRate | back to summary |
|---|---|
| public default ExchangeRate getExchangeRate(String baseCode, String termCode) Access a
| |
| getReversed | back to summary |
|---|---|
| public default ExchangeRate getReversed(ExchangeRate rate) The method reverses the
| |
| isAvailable | back to summary |
|---|---|
| public default boolean isAvailable(ConversionQuery conversionQuery) Checks if an
| |
| isAvailable | back to summary |
|---|---|
| public default boolean isAvailable(CurrencyUnit base, CurrencyUnit term) Checks if an
| |
| isAvailable | back to summary |
|---|---|
| public default boolean isAvailable(String baseCode, String termCode) Checks if an
| |