public static class DefaultExchangeRate.Builder extends Object
ExchangeRate. Note that
instances of this class are not thread-safe.| Constructor and Description |
|---|
Builder(javax.money.convert.ConversionContext context)
Sets the exchange rate type
|
Builder(javax.money.convert.ExchangeRate rate)
Sets the exchange rate type
|
Builder(String provider,
javax.money.convert.RateType rateType)
Sets the exchange rate type
|
| Modifier and Type | Method and Description |
|---|---|
DefaultExchangeRate |
build()
Builds a new instance of
ExchangeRate. |
DefaultExchangeRate.Builder |
setBase(javax.money.CurrencyUnit base)
Sets the base
CurrencyUnit |
DefaultExchangeRate.Builder |
setContext(javax.money.convert.ConversionContext conversionContext)
Sets the provider to be applied.
|
DefaultExchangeRate.Builder |
setFactor(javax.money.NumberValue factor)
Sets the conversion factor, as the factor
base * factor = target. |
DefaultExchangeRate.Builder |
setRate(javax.money.convert.ExchangeRate rate)
Initialize the
DefaultExchangeRate.Builder with an ExchangeRate. |
DefaultExchangeRate.Builder |
setRateChain(javax.money.convert.ExchangeRate... exchangeRates)
Sets the
ExchangeRate chain. |
DefaultExchangeRate.Builder |
setRateChain(List<javax.money.convert.ExchangeRate> exchangeRates)
Sets the
ExchangeRate chain. |
DefaultExchangeRate.Builder |
setTerm(javax.money.CurrencyUnit term)
Sets the terminating (target)
CurrencyUnit |
public Builder(String provider, javax.money.convert.RateType rateType)
rateType - the RateType containedpublic Builder(javax.money.convert.ConversionContext context)
context - the ConversionContext to be appliedpublic Builder(javax.money.convert.ExchangeRate rate)
rate - the ExchangeRate to be appliedpublic DefaultExchangeRate.Builder setBase(javax.money.CurrencyUnit base)
CurrencyUnitbase - to base (source) CurrencyUnit to be appliedpublic DefaultExchangeRate.Builder setTerm(javax.money.CurrencyUnit term)
CurrencyUnitterm - to terminating CurrencyUnit to be appliedpublic DefaultExchangeRate.Builder setRateChain(javax.money.convert.ExchangeRate... exchangeRates)
ExchangeRate chain.exchangeRates - the ExchangeRate chain to be appliedpublic DefaultExchangeRate.Builder setRateChain(List<javax.money.convert.ExchangeRate> exchangeRates)
ExchangeRate chain.exchangeRates - the ExchangeRate chain to be appliedpublic DefaultExchangeRate.Builder setFactor(javax.money.NumberValue factor)
base * factor = target.factor - the factor.public DefaultExchangeRate.Builder setContext(javax.money.convert.ConversionContext conversionContext)
conversionContext - the ConversionContext, not null.public DefaultExchangeRate build()
ExchangeRate.ExchangeRate.IllegalArgumentException - if the rate could not be built.public DefaultExchangeRate.Builder setRate(javax.money.convert.ExchangeRate rate)
DefaultExchangeRate.Builder with an ExchangeRate. This is
useful for creating a new rate, reusing some properties from an
existing one.rate - the base rateCopyright © 2012-2014 JavaMoney. All Rights Reserved.