Top Description Constructors Methods
javax.money

public final Class RoundingQueryBuilder

extends AbstractQueryBuilder<RoundingQueryBuilder, RoundingQuery>
Class Inheritance
Imports
java.util.Objects

Builder used to construct new instances of RoundingQuery}.

Note this class is NOT thread-safe.

Constructor Summary

AccessConstructor and Description
private
RoundingQueryBuilder()

Default constructor.

private
RoundingQueryBuilder(RoundingQuery
the rounding query, used as a template, not null.
roundingQuery
)

Creates a new RoundingQueryBuilder.

Method Summary

Modifier and TypeMethod and Description
public RoundingQuery

Returns:

a new javax.money.RoundingQuery instance.
build
()

Implements abstract javax.money.AbstractQueryBuilder.build.

Creates a new instance of javax.money.RoundingQuery.
public static RoundingQueryBuilder

Returns:

Creates a new RoundingQueryBuilder.
of
()

public static RoundingQueryBuilder

Returns:

a new javax.money.RoundingQueryBuilder instance, never null.
of
(RoundingQuery
the rounding query, used as a template, not null.
roundingQuery
)

Creates a new RoundingQueryBuilder.

public RoundingQueryBuilder

Returns:

this instance for chaining
setCurrency
(CurrencyUnit
the target CurrencyUnit not null.
currencyUnit
)

Sets the target CurrencyUnit, which defines a rounding targeting a concrete CurrencyUnit.

public RoundingQueryBuilder

Returns:

this instance for chaining
setRoundingName
(String
the (custom) rounding name expression, not null.
roundingName
)

Sets the rounding names of the MonetaryRounding instances.

public RoundingQueryBuilder

Returns:

this instance for chaining
setScale
(int
the target scale, >0.
scale
)

Sets the target scale.

Inherited from javax.money.AbstractQueryBuilder:
setsetProviderNamesetProviderNamessetProviderNamessetTargetType

Constructor Detail

RoundingQueryBuilderback to summary
private RoundingQueryBuilder()

Default constructor.

RoundingQueryBuilderback to summary
private RoundingQueryBuilder(RoundingQuery roundingQuery)

Creates a new RoundingQueryBuilder.

Parameters
roundingQuery:RoundingQuery

the rounding query, used as a template, not null.

Method Detail

buildback to summary
public RoundingQuery build()

Implements abstract javax.money.AbstractQueryBuilder.build.

Creates a new instance of javax.money.RoundingQuery.

Returns:RoundingQuery

a new javax.money.RoundingQuery instance.

ofback to summary
public static RoundingQueryBuilder of()
Returns:RoundingQueryBuilder

Creates a new RoundingQueryBuilder.

ofback to summary
public static RoundingQueryBuilder of(RoundingQuery roundingQuery)

Creates a new RoundingQueryBuilder.

Parameters
roundingQuery:RoundingQuery

the rounding query, used as a template, not null.

Returns:RoundingQueryBuilder

a new javax.money.RoundingQueryBuilder instance, never null.

setCurrencyback to summary
public RoundingQueryBuilder setCurrency(CurrencyUnit currencyUnit)

Sets the target 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.

Parameters
currencyUnit:CurrencyUnit

the target CurrencyUnit not null.

Returns:RoundingQueryBuilder

this instance for chaining

setRoundingNameback to summary
public RoundingQueryBuilder setRoundingName(String roundingName)

Sets the rounding names of the 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.

Parameters
roundingName:String

the (custom) rounding name expression, not null.

Returns:RoundingQueryBuilder

this instance for chaining

setScaleback to summary
public RoundingQueryBuilder setScale(int scale)

Sets the target scale. This allows to define the scale required. If not specified as additional attribute, by default, RoundingMode.HALF_EVEN is used hereby.

Parameters
scale:int

the target scale, >0.

Returns:RoundingQueryBuilder

this instance for chaining