public interface RoundingProviderSpi
CurrencyUnit
. The JSRs implementation already provides default
roundings. By registering instances of this interface using the JDK
ServiceLoader
, 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 |
---|---|
javax.money.MonetaryAdjuster |
getCashRounding(javax.money.CurrencyUnit currency)
Access the current valid rounding for the given
CurrencyUnit . |
javax.money.MonetaryAdjuster |
getCashRounding(javax.money.CurrencyUnit currency,
long timestamp)
Access the cash rounding for the given
CurrencyUnit , that was
valid at the given timestamp. |
javax.money.MonetaryAdjuster |
getCustomRounding(String customRoundingId)
Access an
MonetaryAdjuster for custom rounding
MonetaryAmount instances. |
Set<String> |
getCustomRoundingIds()
Access the ids of the custom roundigs defined by this provider.
|
javax.money.MonetaryAdjuster |
getRounding(javax.money.CurrencyUnit currency)
Access the current valid rounding for the given
CurrencyUnit . |
javax.money.MonetaryAdjuster |
getRounding(javax.money.CurrencyUnit currency,
long timestamp)
Access the rounding for the given
CurrencyUnit , that was valid at
the given timestamp. |
javax.money.MonetaryAdjuster getRounding(javax.money.CurrencyUnit currency)
CurrencyUnit
.
Instances of MonetaryAdjuster
returned, must be thread safe and
immutable.
currency
- the currency for which a rounding operator should be obtained,
not null
.null
.javax.money.MonetaryAdjuster getRounding(javax.money.CurrencyUnit currency, long timestamp)
CurrencyUnit
, that was valid at
the given timestamp.
Instances of MonetaryAdjuster
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
.javax.money.MonetaryAdjuster getCashRounding(javax.money.CurrencyUnit currency)
CurrencyUnit
.
Instances of MonetaryAdjuster
returned, must be thread safe and
immutable.
currency
- the currency for which a rounding operator should be obtained,
not null
.null
.javax.money.MonetaryAdjuster getCashRounding(javax.money.CurrencyUnit currency, long timestamp)
CurrencyUnit
, that was
valid at the given timestamp.
Instances of MonetaryAdjuster
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
.javax.money.MonetaryAdjuster getCustomRounding(String customRoundingId)
MonetaryAdjuster
for custom rounding
MonetaryAmount
instances.customRounding
- The customRounding identifier.MonetaryAdjuster
implementing the
rounding, or null
.Set<String> getCustomRoundingIds()
null
.Copyright © 2012–2013 JSR 354 - Expert Group. All rights reserved.