public final class RoundingQueryBuilder extends AbstractQueryBuilder<RoundingQueryBuilder,RoundingQuery>
Note this class is NOT thread-safe.
Modifier and Type | Method and Description |
---|---|
RoundingQuery |
build()
Creates a new instance of
RoundingQuery . |
static RoundingQueryBuilder |
of()
Creates a new RoundingQueryBuilder.
|
static RoundingQueryBuilder |
of(RoundingQuery roundingQuery)
Creates a new RoundingQueryBuilder.
|
RoundingQueryBuilder |
setCurrency(CurrencyUnit currencyUnit)
Sets the target
CurrencyUnit , which defines a rounding targeting a concrete CurrencyUnit . |
RoundingQueryBuilder |
setRoundingName(String roundingName)
Sets the rounding names of the
MonetaryRounding instances. |
RoundingQueryBuilder |
setScale(int scale)
Sets the target scale.
|
set, setProviderName, setProviderNames, setProviderNames, setTargetType
importContext, importContext, removeAttributes, set, set, set, set, set, set, set, set, set, toString
public RoundingQueryBuilder setRoundingName(String roundingName)
MonetaryRounding
instances. This method allows to
access the MonetaryRounding
instances by passing a name, which most of the time
identifies a certain rounding instance. Each entry is first matched as name on equality. If no instance
with such a name exists, the value passed is interpreted as a regular
expression to lookup roundings.roundingName
- the (custom) rounding name expression, not null
.public RoundingQueryBuilder setScale(int scale)
scale
- the target scale, >0.public RoundingQueryBuilder setCurrency(CurrencyUnit currencyUnit)
CurrencyUnit
, which defines a rounding targeting a concrete CurrencyUnit
.
Typically this determines all other properties, such as scale and the concrete rounding algorithm. With
rounding names, depending on the implementation, additional subselections are possible. Similarly
additional attributes can be used to select special rounding instances, e.g. for cash rounding.currencyUnit
- the target CurrencyUnit
not null.public RoundingQuery build()
RoundingQuery
.build
in class AbstractQueryBuilder<RoundingQueryBuilder,RoundingQuery>
RoundingQuery
instance.public static RoundingQueryBuilder of()
public static RoundingQueryBuilder of(RoundingQuery roundingQuery)
roundingQuery
- the rounding query, used as a template, not null.RoundingQueryBuilder
instance, never null.Copyright © 2012–2016 JSR 354 - Expert Group. All rights reserved.