public class FileExchangeRateProvider extends Object implements ExchangeRateProvider
| Modifier and Type | Field and Description |
|---|---|
protected static String |
PARAM_CURRENCY_CONFIG |
| Constructor and Description |
|---|
FileExchangeRateProvider() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
double |
getExchangeRate(String sourceCurrencyCode,
String targetCurrencyCode)
Returns the currently known exchange rate between two currencies.
|
int |
hashCode() |
void |
inform(ResourceLoader loader)
Passes a ResourceLoader, used to read config files from e.g.
|
void |
init(Map<String,String> params)
Initializes the provider by passing in a set of key/value configs as a map.
|
Set<String> |
listAvailableCurrencies()
List all configured currency codes which are valid as source/target for this Provider
|
boolean |
reload()
Ask the currency provider to explicitly reload/refresh its configuration.
|
String |
toString() |
protected static final String PARAM_CURRENCY_CONFIG
public double getExchangeRate(String sourceCurrencyCode, String targetCurrencyCode)
getExchangeRate in interface ExchangeRateProvidersourceCurrencyCode - The source currency being converted from.targetCurrencyCode - The target currency being converted to.SolrException - if the requested currency pair cannot be foundpublic Set<String> listAvailableCurrencies()
ExchangeRateProviderlistAvailableCurrencies in interface ExchangeRateProviderpublic boolean reload()
throws SolrException
ExchangeRateProviderreload in interface ExchangeRateProviderSolrException - if there is a problem reloadingpublic void init(Map<String,String> params) throws SolrException
ExchangeRateProviderImportant: Custom config params must be removed from the map before returning
init in interface ExchangeRateProviderparams - a @Map of key/value config params to initialize the providerSolrExceptionpublic void inform(ResourceLoader loader) throws SolrException
ExchangeRateProviderTypically called after init
inform in interface ExchangeRateProviderloader - a @ResourceLoader instanceSolrExceptionCopyright © 2000-2020 Apache Software Foundation. All Rights Reserved.