Interface CurrencyConversionService
- All Superinterfaces:
Service
public interface CurrencyConversionService extends Service
Service for converting a monetary amount from one
currency to another, at a given point in time, using
a specific currency "API".
-
Method Summary
Modifier and Type Method Description java.math.BigDecimal
convert(java.math.BigDecimal amount, CurrencyCode from, CurrencyCode to, java.util.Date date, CurrencyConverter converter)
Converts an amount from one currency to anotherjava.util.List<java.lang.String>
listAPIs()
Lists the available APIs for a user to choose from when creating a CurrencyConverter.void
registerAPI(CurrencyConversionAPI api)
Registers additional APIs for custom service providers.
-
Method Details
-
convert
java.math.BigDecimal convert(java.math.BigDecimal amount, CurrencyCode from, CurrencyCode to, java.util.Date date, CurrencyConverter converter) throws CurrencyConversionAPIUnavailableExceptionConverts an amount from one currency to another- Parameters:
amount
- value to be convertedfrom
-CurrencyCode
in which amount is availableto
- desiredCurrencyCode
in which amount is to be converteddate
-Date
of conversion (need not be "now", could be an historic conversion)converter
-CurrencyConverter
converter which needs to be used for conversion- Throws:
CurrencyConversionAPIUnavailableException
-
listAPIs
java.util.List<java.lang.String> listAPIs()Lists the available APIs for a user to choose from when creating a CurrencyConverter. The API "Data" is always available; it is the converter driven by the CurrencyConversionFactor model. -
registerAPI
Registers additional APIs for custom service providers.
-