public final class RoundingContext extends AbstractContext implements Serializable, CurrencySupplier
MonetaryRounding in a
platform independent way. Each RoundingContext instance hereby has a roundingId, which links
to the RoundingProviderSpi that must of the according rounding instance. The
default roundingId is default.
A RoundingContext can take up arbitrary attributes that must be documented by the
RoundingProviderSpi implementations.
Examples for such additional attributes are
RoundingMode, MathContext, additional regional information,
e.g. if a given rounding is targeting cash rounding.
This class is immutable, serializable, thread-safe.
KEY_PROVIDER| Modifier and Type | Method and Description |
|---|---|
CurrencyUnit |
getCurrency()
Get the basic
CurrencyUnit, which is based for this rounding type. |
String |
getRoundingName()
Get the (custom) rounding id.
|
RoundingContextBuilder |
toBuilder()
Allows to convert a instance into the corresponding
CurrencyContextBuilder, which allows
to change the values and of another CurrencyContext instance. |
public String getRoundingName()
public CurrencyUnit getCurrency()
CurrencyUnit, which is based for this rounding type.getCurrency in interface CurrencySupplierpublic RoundingContextBuilder toBuilder()
CurrencyContextBuilder, which allows
to change the values and of another CurrencyContext instance.Copyright © 2012–2015 JSR 354 - Expert Group. All rights reserved.