java.lang.Object
javax.money.AbstractContextBuilder<B,C>
javax.money.AbstractQueryBuilder<MonetaryAmountFactoryQueryBuilder,MonetaryAmountFactoryQuery>
javax.money.MonetaryAmountFactoryQueryBuilder
public final class MonetaryAmountFactoryQueryBuilder extends AbstractQueryBuilder<MonetaryAmountFactoryQueryBuilder,MonetaryAmountFactoryQuery>
Builder class for creating new instances of
MonetaryAmountFactoryQuery
that can be passed
to access MonetaryAmountFactory
instances using a possible complex query.
Note this class is NOT thread-safe.
-
Method Summary
Modifier and Type Method Description MonetaryAmountFactoryQuery
build()
Creates a new instance ofMonetaryAmountFactoryQuery
based on the values of this Builder.static MonetaryAmountFactoryQueryBuilder
of()
Creates a new instance ofCurrencyQueryBuilder
.static MonetaryAmountFactoryQueryBuilder
of(MonetaryAmountFactoryQuery monetaryAmountFactoryQuery)
Creates a new instance ofCurrencyQueryBuilder
.MonetaryAmountFactoryQueryBuilder
setFixedScale(boolean fixedScale)
Sets the flag if the scale should fixed, meaning minimal scale and maximal scale are always equally sized.MonetaryAmountFactoryQueryBuilder
setMaxScale(int maxScale)
Sets the maximal scale to be supported.MonetaryAmountFactoryQueryBuilder
setPrecision(int precision)
Sets the required precision, the value 0 models unlimited precision.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
-
setMaxScale
Sets the maximal scale to be supported.- Parameters:
maxScale
- the max scale, >= 0.- Returns:
- this Builder for chaining.
-
setPrecision
Sets the required precision, the value 0 models unlimited precision.- Parameters:
precision
- the precision, >= 0, 0 meaning unlimited.- Returns:
- this Builder for chaining.
-
setFixedScale
Sets the flag if the scale should fixed, meaning minimal scale and maximal scale are always equally sized.- Parameters:
fixedScale
- the fixed scale flag.- Returns:
- this Builder for chaining.
-
build
Creates a new instance ofMonetaryAmountFactoryQuery
based on the values of this Builder. Note that the Builder supports creation of several Builder instances from the a common Builder instance. But be aware that the keys and values contained are themselves not recursively cloned (deep-copy).- Specified by:
build
in classAbstractQueryBuilder<MonetaryAmountFactoryQueryBuilder,MonetaryAmountFactoryQuery>
- Returns:
- a new
MonetaryAmountFactoryQuery
instance.
-
of
Creates a new instance ofCurrencyQueryBuilder
.- Returns:
- a new
CurrencyQueryBuilder
instance, never null.
-
of
public static MonetaryAmountFactoryQueryBuilder of(MonetaryAmountFactoryQuery monetaryAmountFactoryQuery)Creates a new instance ofCurrencyQueryBuilder
.- Parameters:
monetaryAmountFactoryQuery
-MonetaryAmountFactoryQuery
used for initializing this builder.- Returns:
- a new
MonetaryAmountFactoryQueryBuilder
instance, never null.
-