javax.money.MonetaryRounding. In general it is determined by the
implementation, what roundings are provided. Nevertheless the following queries must be supported:
java.math.MathContext as
additional generic attribute.javax.money.CurrencyUnit. This method should return the most
appropriate rounding for a currency. If no
currency specific rounding is available, it should return a rounding with scale==currency
.getDefaultFractionUnits(), java.math.RoundingMode = RoundingMode.HALF_EVEN.This class is immutable, thread-safe and serializable.
| Modifier and Type | Field 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 |
| Access | Constructor and Description |
|---|---|
| pack-priv | RoundingQuery(RoundingQueryBuilder
the corresponding builder, not null. builder)Constructor, used from the |
| Modifier and Type | Method and Description |
|---|---|
| public CurrencyUnit | Returns: the CurrencyUnit, or null.Implements javax. |
| public String | |
| public Integer | |
| public RoundingQueryBuilder | Returns: a newjavax.money.RoundingQueryBuilder instance, never null.Creates a new builder instances, initialized with the data from this one. |
| KEY_QUERY_ROUNDING_NAME | back to summary |
|---|---|
| pack-priv static final String KEY_QUERY_ROUNDING_NAME Attribute key used for the rounding name attribute. | |
| KEY_QUERY_SCALE | back to summary |
|---|---|
| pack-priv static final String KEY_QUERY_SCALE Attribute key used for the scale attribute. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| RoundingQuery | back to summary |
|---|---|
| pack-priv RoundingQuery(RoundingQueryBuilder builder) Constructor, used from the
| |
| getCurrency | back to summary |
|---|---|
| public CurrencyUnit getCurrency() Implements javax. 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.
| |
| getRoundingName | back to summary |
|---|---|
| public String getRoundingName() Gets the target rounding name. This method allows to
access the
| |
| getScale | back 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.
| |
| toBuilder | back to summary |
|---|---|
| public RoundingQueryBuilder toBuilder() Creates a new builder instances, initialized with the data from this one.
| |