- 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 accessingCurrencyConversioninstances. 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
-
Fields inherited from class javax.money.AbstractContext
KEY_PROVIDER
-
-
Method Summary
Modifier and Type Method Description CurrencyUnitgetBaseCurrency()Get the base currency.CurrencyUnitgetCurrency()Get the terminating currency.java.util.Set<RateType>getRateTypes()Get the rate types set.ConversionQueryBuildertoBuilder()Creates a new Builder preinitialized with values from this instance.-
Methods inherited from class javax.money.AbstractQuery
getProviderNames, getTargetType
-
-
-
-
Method Detail
-
getRateTypes
public java.util.Set<RateType> getRateTypes()
Get the rate types set.- Returns:
- the rate types set, or an empty array, but never null.
-
getBaseCurrency
public CurrencyUnit getBaseCurrency()
Get the base currency. This attribute is optional, when aCurrencyConversionis accessed. It is optional if accessing instances ofExchangeRateProvider. If set it can constraint aCurrencyConversionorExchangeRateProviderto 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
public CurrencyUnit getCurrency()
Get the terminating currency. This attribute is required, when aCurrencyConversionis accessed. It is optional if accessing instances ofExchangeRateProvider.- Specified by:
getCurrencyin interfaceCurrencySupplier- Returns:
- the terminating CurrencyUnit, or null.
-
toBuilder
public ConversionQueryBuilder toBuilder()
Creates a new Builder preinitialized with values from this instance.- Returns:
- a new Builder, never null.
-
-