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 CurrencyQuery
build()
Creates a new instance ofCurrencyQuery
.static CurrencyQueryBuilder
of()
Creates a new instance ofCurrencyQueryBuilder
.static CurrencyQueryBuilder
of(CurrencyQuery currencyQuery)
Creates a new instance ofCurrencyQueryBuilder
.CurrencyQueryBuilder
setCountries(java.util.Locale... countries)
Sets the country for which currencies should be requested.CurrencyQueryBuilder
setCurrencyCodes(java.lang.String... codes)
Sets the currency code, or the regular expression to select codes.CurrencyQueryBuilder
setNumericCodes(int... codes)
Set the numeric code.Methods inherited from class javax.money.AbstractQueryBuilder
set, setProviderName, setProviderNames, setProviderNames, setTargetType
Methods 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:
build
in classAbstractQueryBuilder<CurrencyQueryBuilder,CurrencyQuery>
- Returns:
- a new
CurrencyQuery
instance, never null.
-
of
Creates a new instance ofCurrencyQueryBuilder
.- Returns:
- a new
CurrencyQueryBuilder
instance, never null.
-
of
Creates a new instance ofCurrencyQueryBuilder
.- Parameters:
currencyQuery
-CurrencyQuery
used for initializing this builder.- Returns:
- a new
CurrencyQueryBuilder
instance, never null.
-