java.lang.Object
javax.money.AbstractContextBuilder<CurrencyQueryBuilder,CurrencyQuery>
javax.money.AbstractQueryBuilder<CurrencyQueryBuilder,CurrencyQuery>
javax.money.CurrencyQueryBuilder
public final class CurrencyQueryBuilder
extends AbstractQueryBuilder<CurrencyQueryBuilder,CurrencyQuery>
Builder for queries for accessing
CurrencyUnit instances. If not properties are set the
query should
returns
the default currencies. Similarly if no provider is set explicitly the default ISO currencies as
returned by Currency should be returned.
Note this class is NOT thread-safe.
-
Field Summary
Fields inherited from class javax.money.AbstractContextBuilder
data -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateDefault constructor.privateCurrencyQueryBuilder(CurrencyQuery currencyQuery) Creates a new instance ofCurrencyQueryBuilder. -
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates a new instance ofCurrencyQuery.static CurrencyQueryBuilderof()Creates a new instance ofCurrencyQueryBuilder.static CurrencyQueryBuilderof(CurrencyQuery currencyQuery) Creates a new instance ofCurrencyQueryBuilder.setCountries(Locale... countries) Sets the country for which currencies should be requested.setCurrencyCodes(String... codes) Sets the currency code, or the regular expression to select codes.setNumericCodes(int... codes) Set the numeric code.Methods inherited from class javax.money.AbstractQueryBuilder
set, setProviderName, setProviderNames, setProviderNames, setTargetTypeMethods inherited from class javax.money.AbstractContextBuilder
importContext, importContext, removeAttributes, set, set, set, set, set, set, set, set, set, toString
-
Constructor Details
-
CurrencyQueryBuilder
private CurrencyQueryBuilder()Default constructor. -
CurrencyQueryBuilder
Creates a new instance ofCurrencyQueryBuilder.- Parameters:
currencyQuery-CurrencyQueryused for initializing this builder.
-
-
Method Details
-
setCountries
Sets the country for which currencies should be requested.- Parameters:
countries- The ISO countries.- Returns:
- the query for chaining.
-
setCurrencyCodes
Sets the currency code, or the regular expression to select codes.- Parameters:
codes- the currency codes or code expressions, not null.- Returns:
- the query for chaining.
-
setNumericCodes
Set the numeric code. Setting it to -1 search for currencies that have no numeric code.- Parameters:
codes- the numeric codes.- Returns:
- the query for chaining.
-
build
Creates a new instance ofCurrencyQuery.- Specified by:
buildin classAbstractQueryBuilder<CurrencyQueryBuilder,CurrencyQuery> - Returns:
- a new
CurrencyQueryinstance, never null.
-
of
Creates a new instance ofCurrencyQueryBuilder.- Returns:
- a new
CurrencyQueryBuilderinstance, never null.
-
of
Creates a new instance ofCurrencyQueryBuilder.- Parameters:
currencyQuery-CurrencyQueryused for initializing this builder.- Returns:
- a new
CurrencyQueryBuilderinstance, never null.
-