java.lang.Object
javax.money.AbstractContextBuilder<B,C>
javax.money.AbstractQueryBuilder<ConversionQueryBuilder,ConversionQuery>
javax.money.convert.ConversionQueryBuilder
public final class ConversionQueryBuilder extends AbstractQueryBuilder<ConversionQueryBuilder,ConversionQuery>
Builder class for creating new instances of
ConversionQuery
adding detailed
information about a CurrencyConversion
instance.
Note this class is NOT thread-safe.
-
Method Summary
Modifier and Type Method Description ConversionQuery
build()
Creates a new instance ofConversionQuery
.static ConversionQueryBuilder
of()
Creates a newConversionQueryBuilder
instance.static ConversionQueryBuilder
of(ConversionQuery query)
Creates a newConversionQueryBuilder
instance.ConversionQueryBuilder
setBaseCurrency(java.lang.String currencyCode)
Sets the base currency.ConversionQueryBuilder
setBaseCurrency(CurrencyUnit currency)
Sets the base currency.ConversionQueryBuilder
setRateTypes(java.util.Set<RateType> rateTypes)
Set the providers to be considered.ConversionQueryBuilder
setRateTypes(RateType... rateTypes)
Set the providers to be considered.ConversionQueryBuilder
setTermCurrency(java.lang.String currencyCode)
Sets the term currency.ConversionQueryBuilder
setTermCurrency(CurrencyUnit currency)
Sets the term currency.Methods inherited from class javax.money.AbstractQueryBuilder
set, setProviderName, setProviderNames, setProviderNames, setTargetType
Methods inherited from class javax.money.AbstractContextBuilder
importContext, importContext, removeAttributes, set, set, set, set, set, set, set, set, set, toString
-
Method Details
-
setRateTypes
Set the providers to be considered. If not set explicitly the default ISO currencies as returned byCurrency
is used.- Parameters:
rateTypes
- the rate types to use, not null.- Returns:
- the query for chaining.
-
setRateTypes
Set the providers to be considered. If not set explicitly the default ISO currencies as returned byCurrency
is used.- Parameters:
rateTypes
- the rate types to use, not null.- Returns:
- the query for chaining.
-
setBaseCurrency
Sets the base currency.- Parameters:
currency
- the base currency- Returns:
- the query for chaining.
-
setBaseCurrency
Sets the base currency.- Parameters:
currencyCode
- the currency code, resolvable through.MonetaryCurrencies#getCurrency(String, String...)
, not null.- Returns:
- the query for chaining.
-
setTermCurrency
Sets the term currency.- Parameters:
currency
- the base currency- Returns:
- the query for chaining.
-
setTermCurrency
Sets the term currency.- Parameters:
currencyCode
- the currency code, resolvable through.MonetaryCurrencies#getCurrency(String, String...)
, not null.- Returns:
- the query for chaining.
-
build
Creates a new instance ofConversionQuery
.- Specified by:
build
in classAbstractQueryBuilder<ConversionQueryBuilder,ConversionQuery>
- Returns:
- a new
ConversionQuery
instance.
-
of
Creates a newConversionQueryBuilder
instance.- Returns:
- a new
ConversionQueryBuilder
instance, never null.
-
of
Creates a newConversionQueryBuilder
instance.- Parameters:
query
- theConversionQuery
instance to be used as a template.- Returns:
- a new
ConversionQueryBuilder
instance, never null.
-