- 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 ofMonetaryAmountFactoryQuerythat can be passed to accessMonetaryAmountFactoryinstances using a possible complex query.Note this class is NOT thread-safe.
-
-
Method Summary
Modifier and Type Method Description MonetaryAmountFactoryQuerybuild()Creates a new instance ofMonetaryAmountFactoryQuerybased on the values of this Builder.static MonetaryAmountFactoryQueryBuilderof()Creates a new instance ofCurrencyQueryBuilder.static MonetaryAmountFactoryQueryBuilderof(MonetaryAmountFactoryQuery monetaryAmountFactoryQuery)Creates a new instance ofCurrencyQueryBuilder.MonetaryAmountFactoryQueryBuildersetFixedScale(boolean fixedScale)Sets the flag if the scale should fixed, meaning minimal scale and maximal scale are always equally sized.MonetaryAmountFactoryQueryBuildersetMaxScale(int maxScale)Sets the maximal scale to be supported.MonetaryAmountFactoryQueryBuildersetPrecision(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 Detail
-
setMaxScale
public MonetaryAmountFactoryQueryBuilder setMaxScale(int maxScale)
Sets the maximal scale to be supported.- Parameters:
maxScale- the max scale, >= 0.- Returns:
- this Builder for chaining.
-
setPrecision
public MonetaryAmountFactoryQueryBuilder setPrecision(int precision)
Sets the required precision, the value 0 models unlimited precision.- Parameters:
precision- the precision, >= 0, 0 meaning unlimited.- Returns:
- this Builder for chaining.
-
setFixedScale
public MonetaryAmountFactoryQueryBuilder setFixedScale(boolean fixedScale)
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
public MonetaryAmountFactoryQuery build()
Creates a new instance ofMonetaryAmountFactoryQuerybased 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:
buildin classAbstractQueryBuilder<MonetaryAmountFactoryQueryBuilder,MonetaryAmountFactoryQuery>- Returns:
- a new
MonetaryAmountFactoryQueryinstance.
-
of
public static MonetaryAmountFactoryQueryBuilder of()
Creates a new instance ofCurrencyQueryBuilder.- Returns:
- a new
CurrencyQueryBuilderinstance, never null.
-
of
public static MonetaryAmountFactoryQueryBuilder of(MonetaryAmountFactoryQuery monetaryAmountFactoryQuery)
Creates a new instance ofCurrencyQueryBuilder.- Parameters:
monetaryAmountFactoryQuery-MonetaryAmountFactoryQueryused for initializing this builder.- Returns:
- a new
MonetaryAmountFactoryQueryBuilderinstance, never null.
-
-