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.
-
Constructor Summary
Constructors Constructor Description AbstractQueryBuilder()
Initializes the query builder, as a default query builder. -
Method Summary
Modifier and Type Method Description abstract C
build()
Creates a newAbstractQuery
with the data from this Builder instance.B
set(java.util.List<java.lang.String> providers)
Set the providers to be considered.B
setProviderName(java.lang.String provider)
Simple override, that sets the provider as provider to use.B
setProviderNames(java.lang.String... providers)
Set the providers to be considered.B
setProviderNames(java.util.List<java.lang.String> providers)
Set the providers to be considered.B
setTargetType(java.lang.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 byCurrency
is 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 byCurrency
is 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:
setProviderName
in 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 newAbstractQuery
with the data from this Builder instance.- Specified by:
build
in classAbstractContextBuilder<B extends AbstractQueryBuilder,C extends AbstractQuery>
- Returns:
- a new
AbstractQuery
. nevernull
.
-