- 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 accessingCurrencyUnitinstances. 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 byCurrencyshould 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, setTargetType
-
Methods inherited from class javax.money.AbstractContextBuilder
importContext, importContext, removeAttributes, set, set, set, set, set, set, set, set, set, toString
-
-
-
-
Method Detail
-
setCountries
public CurrencyQueryBuilder setCountries(java.util.Locale... countries)
Sets the country for which currencies should be requested.- Parameters:
countries- The ISO countries.- Returns:
- the query for chaining.
-
setCurrencyCodes
public CurrencyQueryBuilder setCurrencyCodes(java.lang.String... codes)
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
public CurrencyQueryBuilder setNumericCodes(int... codes)
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
public CurrencyQuery build()
Creates a new instance ofCurrencyQuery.- Specified by:
buildin classAbstractQueryBuilder<CurrencyQueryBuilder,CurrencyQuery>- Returns:
- a new
CurrencyQueryinstance, never null.
-
of
public static CurrencyQueryBuilder of()
Creates a new instance ofCurrencyQueryBuilder.- Returns:
- a new
CurrencyQueryBuilderinstance, never null.
-
of
public static CurrencyQueryBuilder of(CurrencyQuery currencyQuery)
Creates a new instance ofCurrencyQueryBuilder.- Parameters:
currencyQuery-CurrencyQueryused for initializing this builder.- Returns:
- a new
CurrencyQueryBuilderinstance, never null.
-
-