public class LazyBoundCurrencyConversion extends AbstractCurrencyConversion implements javax.money.convert.CurrencyConversion
CurrencyConversion
that is converting to a
specific target CurrencyUnit
. Each instance of this class is bound to
a specific ExchangeRateProvider
, a term CurrencyUnit
and a
target timestamp.Constructor and Description |
---|
LazyBoundCurrencyConversion(javax.money.CurrencyUnit termCurrency,
javax.money.convert.ExchangeRateProvider rateProvider,
javax.money.convert.ConversionContext conversionContext) |
Modifier and Type | Method and Description |
---|---|
javax.money.convert.ExchangeRate |
getExchangeRate(javax.money.MonetaryAmount amount)
Get the exchange rate type that this provider instance is providing data
for.
|
java.lang.String |
toString() |
javax.money.convert.CurrencyConversion |
with(javax.money.convert.ConversionContext conversionContext)
Get a new
CurrencyConversion using the given
ConversionContext with additional attributes. |
apply, getConversionContext, getTermCurrency
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public LazyBoundCurrencyConversion(javax.money.CurrencyUnit termCurrency, javax.money.convert.ExchangeRateProvider rateProvider, javax.money.convert.ConversionContext conversionContext)
public javax.money.convert.ExchangeRate getExchangeRate(javax.money.MonetaryAmount amount)
getExchangeRate
in interface javax.money.convert.CurrencyConversion
getExchangeRate
in class AbstractCurrencyConversion
amount
- the amount to be converted.AbstractCurrencyConversion.apply(MonetaryAmount)
public java.lang.String toString()
toString
in class AbstractCurrencyConversion
public javax.money.convert.CurrencyConversion with(javax.money.convert.ConversionContext conversionContext)
javax.money.convert.CurrencyConversion
CurrencyConversion
using the given
ConversionContext
with additional attributes.with
in interface javax.money.convert.CurrencyConversion
with
in class AbstractCurrencyConversion
conversionContext
- the ConversionContext
to be applied, not null
CurrencyConversion
, based on this
instance, but with a changed ConversionContext
to be
applied. if the amount can not be converted.