Top Description Fields Constructors Methods
javax.money

public final Class RoundingQuery

extends AbstractQuery
implements CurrencySupplier
Class Inheritance
All Implemented Interfaces
javax.money.CurrencySupplier

Query for accessing instances of javax.money.MonetaryRounding. In general it is determined by the implementation, what roundings are provided. Nevertheless the following queries must be supported: All other roundings including cash rounding and historical roundings are optional.

This class is immutable, thread-safe and serializable.

Field Summary

Modifier and TypeField and Description
pack-priv static final String
KEY_QUERY_ROUNDING_NAME

Attribute key used for the rounding name attribute.

pack-priv static final String
KEY_QUERY_SCALE

Attribute key used for the scale attribute.

private static final long
Inherited from javax.money.AbstractQuery:
KEY_QUERY_PROVIDERSKEY_QUERY_TARGET_TYPEKEY_QUERY_TIMESTAMP

Constructor Summary

AccessConstructor and Description
pack-priv
RoundingQuery(RoundingQueryBuilder
the corresponding builder, not null.
builder
)

Constructor, used from the javax.money.RoundingQueryBuilder.

Method Summary

Modifier and TypeMethod and Description
public CurrencyUnit

Returns:

the CurrencyUnit, or null.
getCurrency
()

Implements javax.money.CurrencySupplier.getCurrency.

Sets the target CurrencyUnit.
public String

Returns:

the rounding id or null.
getRoundingName
()

Gets the target rounding name.

public Integer

Returns:

the target scale or null.
getScale
()

Gets the target scale.

public RoundingQueryBuilder

Returns:

a new javax.money.RoundingQueryBuilder instance, never null.
toBuilder
()

Creates a new builder instances, initialized with the data from this one.

Inherited from javax.money.AbstractQuery:
getProviderNamesgetTargetType

Field Detail

KEY_QUERY_ROUNDING_NAMEback to summary
pack-priv static final String KEY_QUERY_ROUNDING_NAME

Attribute key used for the rounding name attribute.

KEY_QUERY_SCALEback to summary
pack-priv static final String KEY_QUERY_SCALE

Attribute key used for the scale attribute.

serialVersionUIDback to summary
private static final long serialVersionUID

Hides javax.money.AbstractQuery.serialVersionUID.

Constructor Detail

RoundingQueryback to summary
pack-priv RoundingQuery(RoundingQueryBuilder builder)

Constructor, used from the javax.money.RoundingQueryBuilder.

Parameters
builder:RoundingQueryBuilder

the corresponding builder, not null.

Method Detail

getCurrencyback to summary
public CurrencyUnit getCurrency()

Implements javax.money.CurrencySupplier.getCurrency.

Sets the target CurrencyUnit. Typically this determines all other properties, such as scale and the concrete rounding algorithm. With rounding names, depending on the implementation, additional sub-selections are possible. Similarly additional attributes can be used to select special rounding instances, e.g. for cash rounding.

Returns:CurrencyUnit

the CurrencyUnit, or null.

Annotations
@Override
getRoundingNameback to summary
public String getRoundingName()

Gets the target rounding name. This method allows to access the javax.money.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.

Returns:String

the rounding id or null.

getScaleback to summary
public Integer getScale()

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

Returns:Integer

the target scale or null.

toBuilderback to summary
public RoundingQueryBuilder toBuilder()

Creates a new builder instances, initialized with the data from this one.

Returns:RoundingQueryBuilder

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