Module java.money
Package javax.money

Class AbstractQuery

All Implemented Interfaces:
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:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • KEY_QUERY_PROVIDERS

      protected static final String KEY_QUERY_PROVIDERS
      Key for storing the target providers to be queried
      See Also:
    • KEY_QUERY_TIMESTAMP

      protected static final String KEY_QUERY_TIMESTAMP
      Key name for the timestamp attribute.
      See Also:
    • KEY_QUERY_TARGET_TYPE

      protected static final String KEY_QUERY_TARGET_TYPE
      Key name for the target type attribute.
      See Also:
  • Constructor Details

    • AbstractQuery

      protected AbstractQuery(AbstractQueryBuilder builder)
      Constructor, using a builder.
      Parameters:
      builder - the builder, not null.
  • Method Details

    • getProviderNames

      public List<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 like getDefaultProviderNames() should be used.
      Returns:
      the ordered providers, never null.
    • getTargetType

      public 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.