java.lang.Object
javax.money.AbstractContext
javax.money.AbstractQuery
javax.money.convert.ConversionQuery
- All Implemented Interfaces:
Serializable,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:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final StringTHe key used for the base currency attribute.(package private) static final StringTHe key used for the rate types attribute.(package private) static final StringTHe key used for the term currency attribute.private static final longserialVersionUID.Fields inherited from class javax.money.AbstractQuery
KEY_QUERY_PROVIDERS, KEY_QUERY_TARGET_TYPE, KEY_QUERY_TIMESTAMPFields inherited from class javax.money.AbstractContext
KEY_PROVIDER -
Constructor Summary
ConstructorsConstructorDescriptionConversionQuery(ConversionQueryBuilder builder) Constructor, used from the ConversionQueryBuilder. -
Method Summary
Modifier and TypeMethodDescriptionGet the base currency.Get the terminating currency.Get the rate types set.Creates a new Builder preinitialized with values from this instance.Methods inherited from class javax.money.AbstractQuery
getProviderNames, getTargetType
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDserialVersionUID.- See Also:
-
KEY_BASE_CURRENCY
THe key used for the base currency attribute.- See Also:
-
KEY_TERM_CURRENCY
THe key used for the term currency attribute.- See Also:
-
KEY_RATE_TYPES
THe key used for the rate types attribute.- See Also:
-
-
Constructor Details
-
ConversionQuery
ConversionQuery(ConversionQueryBuilder builder) Constructor, used from the ConversionQueryBuilder.- Parameters:
builder- the corresponding builder, not null.
-
-
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 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
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
Creates a new Builder preinitialized with values from this instance.- Returns:
- a new Builder, never null.
-