public interface RoundingProviderSpi
CurrencyUnit
. The JSRs implementation already provides default
roundings. By registering instances of this interface using the
Bootstrap
, the default behaviour can be
overridden and extended, e.g. for supporting also special roundings.
Implementations of this interface must be
Modifier and Type | Method and Description |
---|---|
MonetaryOperator |
getCashRounding(CurrencyUnit currency)
Access the current valid rounding for the given
CurrencyUnit . |
MonetaryOperator |
getCashRounding(CurrencyUnit currency,
long timestamp)
Access the cash rounding for the given
CurrencyUnit , that was
valid at the given timestamp. |
MonetaryOperator |
getCustomRounding(java.lang.String customRoundingId)
Access an
MonetaryOperator for custom rounding
MonetaryAmount instances. |
java.util.Set<java.lang.String> |
getCustomRoundingIds()
Access the ids of the custom roundigs defined by this provider.
|
MonetaryOperator |
getRounding(CurrencyUnit currency)
Access the current valid rounding for the given
CurrencyUnit . |
MonetaryOperator |
getRounding(CurrencyUnit currency,
long timestamp)
Access the rounding for the given
CurrencyUnit , that was valid at
the given timestamp. |
MonetaryOperator |
getRounding(MonetaryContext monetaryContext)
Access a rounding that models the given
MonetaryContext . |
MonetaryOperator getCashRounding(CurrencyUnit currency)
CurrencyUnit
.
Instances of MonetaryOperator
returned, must be thread safe and
immutable.
currency
- the currency for which a rounding operator should be obtained,
not null
.null
.MonetaryOperator getCashRounding(CurrencyUnit currency, long timestamp)
CurrencyUnit
, that was
valid at the given timestamp.
Instances of MonetaryOperator
returned, must be thread safe and
immutable.
currency
- the currency for which a rounding operator should be obtained,
not null
.timestamp
- the target UTC timestamp, when the rounding should be valid.null
.MonetaryOperator getCustomRounding(java.lang.String customRoundingId)
MonetaryOperator
for custom rounding
MonetaryAmount
instances.customRoundingId
- The customRounding identifier.MonetaryOperator
implementing the
rounding, or null
.java.util.Set<java.lang.String> getCustomRoundingIds()
null
.MonetaryOperator getRounding(CurrencyUnit currency)
CurrencyUnit
.
Instances of MonetaryOperator
returned, must be thread safe and
immutable.
currency
- the currency for which a rounding operator should be obtained,
not null
.null
.MonetaryOperator getRounding(CurrencyUnit currency, long timestamp)
CurrencyUnit
, that was valid at
the given timestamp.
Instances of MonetaryOperator
returned, must be thread safe and
immutable.
currency
- the currency for which a rounding operator should be obtained,
not null
.timestamp
- the target UTC timestamp, when the rounding should be valid.null
.MonetaryOperator getRounding(MonetaryContext monetaryContext)
MonetaryContext
.monetaryContext
- The target MonetaryContext
null