Interface CurrencyConversionService
-
- All Known Implementing Classes:
DefaultCurrencyConversionService,NoOpCurrencyConversionService
public interface CurrencyConversionServiceImplementations of this service provide support for currency conversions.- Author:
- Brian Polster (bpolster)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancanCovert(javax.money.CurrencyUnit from, javax.money.CurrencyUnit to)Determine if conversion support is available based on a currencyCode from and to.javax.money.MonetaryAmountconvert(javax.money.MonetaryAmount fromAmount, javax.money.CurrencyUnit toCurrency)Return a MonetaryAmount by applying a currency conversion from the fromAmount to the target currency.
-
-
-
Method Detail
-
canCovert
boolean canCovert(javax.money.CurrencyUnit from, javax.money.CurrencyUnit to)Determine if conversion support is available based on a currencyCode from and to.- Parameters:
from- The currency to convert from.to- The currency to convert to.- Returns:
-
convert
javax.money.MonetaryAmount convert(javax.money.MonetaryAmount fromAmount, javax.money.CurrencyUnit toCurrency)Return a MonetaryAmount by applying a currency conversion from the fromAmount to the target currency.- Parameters:
fromAmount- The MonetaryAmount to convert.toCurrency- The currency to convert to.- Returns:
- A MonetaryAmount in the target currency.
-
-