java.lang.Object
javax.money.AbstractContext
javax.money.AbstractQuery
javax.money.convert.ConversionQuery
- All Implemented Interfaces:
java.io.Serializable
,CurrencySupplier
public final class ConversionQuery extends AbstractQuery implements CurrencySupplier
Query for accessing
CurrencyConversion
instances. If not properties are set the query
should returns the default currencies.
This class is immutable, serializable and thread-safe.
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from class javax.money.AbstractQuery
KEY_QUERY_PROVIDERS, KEY_QUERY_TARGET_TYPE, KEY_QUERY_TIMESTAMP
-
Method Summary
Modifier and Type Method Description CurrencyUnit
getBaseCurrency()
Get the base currency.CurrencyUnit
getCurrency()
Get the terminating currency.java.util.Set<RateType>
getRateTypes()
Get the rate types set.ConversionQueryBuilder
toBuilder()
Creates a new Builder preinitialized with values from this instance.
-
Method Details
-
getRateTypes
Get the rate types set.- Returns:
- the rate types set, or an empty array, but never null.
-
getBaseCurrency
Get the base currency. This attribute is optional, when aCurrencyConversion
is accessed. It is optional if accessing instances ofExchangeRateProvider
. If set it can constraint aCurrencyConversion
orExchangeRateProvider
to only support one type of base currency. By default it is not set, hereby determining the base currency by the amount onto which the conversion is applied.- Returns:
- the base CurrencyUnit, or null.
-
getCurrency
Get the terminating currency. This attribute is required, when aCurrencyConversion
is accessed. It is optional if accessing instances ofExchangeRateProvider
.- Specified by:
getCurrency
in interfaceCurrencySupplier
- Returns:
- the terminating CurrencyUnit, or null.
-
toBuilder
Creates a new Builder preinitialized with values from this instance.- Returns:
- a new Builder, never null.
-