Module java.money
Package javax.money
Class AbstractQueryBuilder<B extends AbstractQueryBuilder,C extends AbstractQuery>
java.lang.Object
javax.money.AbstractContextBuilder<B,C>
javax.money.AbstractQueryBuilder<B,C>
- Direct Known Subclasses:
AmountFormatQueryBuilder,ConversionQueryBuilder,CurrencyQueryBuilder,MonetaryAmountFactoryQueryBuilder,RoundingQueryBuilder
public abstract class AbstractQueryBuilder<B extends AbstractQueryBuilder,C extends AbstractQuery>
extends AbstractContextBuilder<B,C>
This abstract class defines the common generic parts of a query. Queries are used to pass complex parameters sets
to lookup monetary artifacts, e.g.
MonetaryAmountFactory,
MonetaryRounding,
CurrencyUnit, ExchangeRateProvider and .CurrencyConversion.
Instances of this class are not thread-safe and not serializable.
-
Field Summary
Fields inherited from class javax.money.AbstractContextBuilder
data -
Constructor Summary
ConstructorsConstructorDescriptionInitializes the query builder, as a default query builder. -
Method Summary
Modifier and TypeMethodDescriptionabstract Cbuild()Creates a newAbstractQuerywith the data from this Builder instance.Set the providers to be considered.setProviderName(String provider) Simple override, that sets the provider as provider to use.setProviderNames(String... providers) Set the providers to be considered.setProviderNames(List<String> providers) Set the providers to be considered.setTargetType(Class<?> type) Sets the target implementation type required.Methods inherited from class javax.money.AbstractContextBuilder
importContext, importContext, removeAttributes, set, set, set, set, set, set, set, set, set, toString
-
Constructor Details
-
AbstractQueryBuilder
public AbstractQueryBuilder()Initializes the query builder, as a default query builder.
-
-
Method Details
-
setProviderNames
Set the providers to be considered. If not set explicitly the default ISO currencies as returned byCurrencyis used.- Parameters:
providers- the providers to use, not null.- Returns:
- the query builder for chaining.
-
setProviderNames
Set the providers to be considered. If not set explicitly the default ISO currencies as returned byCurrencyis used.- Parameters:
providers- the providers to use, not null.- Returns:
- the query builder for chaining.
-
set
Set the providers to be considered. If not set explicitly the default providers and the corresponding default ordering are used.- Parameters:
providers- the providers in order to use, not null.- Returns:
- the query builder for chaining.
-
setProviderName
Simple override, that sets the provider as provider to use.- Overrides:
setProviderNamein classAbstractContextBuilder<B extends AbstractQueryBuilder,C extends AbstractQuery> - Parameters:
provider- the provider, not null.- Returns:
- the query builder for chaining.
-
setTargetType
Sets 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.- Parameters:
type- the target implementation type, not null.- Returns:
- this query builder for chaining.
-
build
Creates a newAbstractQuerywith the data from this Builder instance.- Specified by:
buildin classAbstractContextBuilder<B extends AbstractQueryBuilder,C extends AbstractQuery> - Returns:
- a new
AbstractQuery. nevernull.
-