public static class TestExchangeRate.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 |
---|---|
TestExchangeRate |
build()
Builds a new instance of
ExchangeRate . |
TestExchangeRate.Builder |
setBase(javax.money.CurrencyUnit base)
Sets the base
CurrencyUnit |
TestExchangeRate.Builder |
setContext(javax.money.convert.ConversionContext conversionContext)
Sets the provider to be applied.
|
TestExchangeRate.Builder |
setFactor(javax.money.NumberValue factor)
Sets the conversion factor, as the factor
base * factor = target . |
TestExchangeRate.Builder |
setRate(javax.money.convert.ExchangeRate rate)
Initialize the
TestExchangeRate.Builder with an ExchangeRate . |
TestExchangeRate.Builder |
setRateChain(javax.money.convert.ExchangeRate... exchangeRates)
Sets the
ExchangeRate chain. |
TestExchangeRate.Builder |
setRateChain(List<javax.money.convert.ExchangeRate> exchangeRates)
Sets the
ExchangeRate chain. |
TestExchangeRate.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 TestExchangeRate.Builder setBase(javax.money.CurrencyUnit base)
CurrencyUnit
base
- to base (source) CurrencyUnit
to be appliedpublic TestExchangeRate.Builder setTerm(javax.money.CurrencyUnit term)
CurrencyUnit
term
- to terminating CurrencyUnit
to be appliedpublic TestExchangeRate.Builder setRateChain(javax.money.convert.ExchangeRate... exchangeRates)
ExchangeRate
chain.exchangeRates
- the ExchangeRate
chain to be appliedpublic TestExchangeRate.Builder setRateChain(List<javax.money.convert.ExchangeRate> exchangeRates)
ExchangeRate
chain.exchangeRates
- the ExchangeRate
chain to be appliedpublic TestExchangeRate.Builder setFactor(javax.money.NumberValue factor)
base * factor = target
.factor
- the factor.public TestExchangeRate.Builder setContext(javax.money.convert.ConversionContext conversionContext)
conversionContext
- the ConversionContext
, not null.public TestExchangeRate build()
ExchangeRate
.ExchangeRate
.IllegalArgumentException
- if the rate could not be built.public TestExchangeRate.Builder setRate(javax.money.convert.ExchangeRate rate)
TestExchangeRate.Builder
with an ExchangeRate
. This is
useful for creating a new rate, reusing some properties from an
existing one.rate
- the base rateCopyright © 2012-2015 JavaMoney. All Rights Reserved.