java.lang.Object
javax.money.AbstractContextBuilder<B,C>
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.
-
Method Summary
Modifier and Type Method Description CurrencyQuerybuild()Creates a new instance ofCurrencyQuery.static CurrencyQueryBuilderof()Creates a new instance ofCurrencyQueryBuilder.static CurrencyQueryBuilderof(CurrencyQuery currencyQuery)Creates a new instance ofCurrencyQueryBuilder.CurrencyQueryBuildersetCountries(java.util.Locale... countries)Sets the country for which currencies should be requested.CurrencyQueryBuildersetCurrencyCodes(java.lang.String... codes)Sets the currency code, or the regular expression to select codes.CurrencyQueryBuildersetNumericCodes(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
-
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.
-