java.lang.Object
javax.money.AbstractContext
javax.money.AbstractQuery
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
AmountFormatQuery
,ConversionQuery
,CurrencyQuery
,MonetaryAmountFactoryQuery
,RoundingQuery
public abstract class AbstractQuery extends AbstractContext
Represents a general context of data targeting an item of type
Q
. Contexts are used to add arbitrary
data that cannot be be mapped in a standard way to the money API, e.g. use case or customer specific
extensions or specialities.Superclasses of this class must be final, immutable, serializable and thread-safe.
- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String
KEY_QUERY_PROVIDERS
Key for storing the target providers to be queriedprotected static java.lang.String
KEY_QUERY_TARGET_TYPE
Key name for the target type attribute.protected static java.lang.String
KEY_QUERY_TIMESTAMP
Key name for the timestamp attribute. -
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractQuery(AbstractQueryBuilder builder)
Constructor, using a builder. -
Method Summary
Modifier and Type Method Description java.util.List<java.lang.String>
getProviderNames()
Returns the providers and their ordering to be considered.java.lang.Class<?>
getTargetType()
Gets the target implementation type required.
-
Field Details
-
KEY_QUERY_PROVIDERS
protected static final java.lang.String KEY_QUERY_PROVIDERSKey for storing the target providers to be queried- See Also:
- Constant Field Values
-
KEY_QUERY_TIMESTAMP
protected static final java.lang.String KEY_QUERY_TIMESTAMPKey name for the timestamp attribute.- See Also:
- Constant Field Values
-
KEY_QUERY_TARGET_TYPE
protected static final java.lang.String KEY_QUERY_TARGET_TYPEKey name for the target type attribute.- See Also:
- Constant Field Values
-
-
Constructor Details
-
AbstractQuery
Constructor, using a builder.- Parameters:
builder
- the builder, not null.
-
-
Method Details
-
getProviderNames
public java.util.List<java.lang.String> getProviderNames()Returns the providers and their ordering to be considered. This information typically must be interpreted by the singleton SPI implementations, which are backing the singleton accessors. If the list returned is empty, the default provider list, determined by methods likegetDefaultProviderNames()
should be used.- Returns:
- the ordered providers, never null.
-
getTargetType
public java.lang.Class<?> getTargetType()Gets the target implementation type required. This can be used to explicitly acquire a specific implementation type and use a query to configure the instance or factory to be returned.- Returns:
- this Builder for chaining.
-