public class DefaultRoundingProvider
extends java.lang.Object
implements javax.money.spi.RoundingProviderSpi
RoundingProviderSpi that creates instances of .javamoney.moneta.internal.DefaultRounding that relies on the default fraction units defined by .Currency#getDefaultFractionDigits().| Constructor and Description |
|---|
DefaultRoundingProvider() |
| Modifier and Type | Method and Description |
|---|---|
javax.money.MonetaryOperator |
getCashRounding(javax.money.CurrencyUnit currency)
Access the current valid rounding for the given
CurrencyUnit. |
javax.money.MonetaryOperator |
getCashRounding(javax.money.CurrencyUnit currency,
long timestamp)
Access the cash rounding for the given
CurrencyUnit, that was
valid at the given timestamp. |
javax.money.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.
|
javax.money.MonetaryOperator |
getRounding(javax.money.CurrencyUnit currency)
Access the current valid rounding for the given
CurrencyUnit. |
javax.money.MonetaryOperator |
getRounding(javax.money.CurrencyUnit currency,
long timestamp)
Access the rounding for the given
CurrencyUnit, that was valid at
the given timestamp. |
javax.money.MonetaryOperator |
getRounding(javax.money.MonetaryContext monetaryContext)
Access a rounding that models the given
MonetaryContext. |
public javax.money.MonetaryOperator getCashRounding(javax.money.CurrencyUnit currency)
javax.money.spi.RoundingProviderSpiCurrencyUnit.
Instances of MonetaryOperator returned, must be thread safe and
immutable.
getCashRounding in interface javax.money.spi.RoundingProviderSpicurrency - the currency for which a rounding operator should be obtained,
not null.null.public javax.money.MonetaryOperator getCashRounding(javax.money.CurrencyUnit currency,
long timestamp)
javax.money.spi.RoundingProviderSpiCurrencyUnit, that was
valid at the given timestamp.
Instances of MonetaryOperator returned, must be thread safe and
immutable.
getCashRounding in interface javax.money.spi.RoundingProviderSpicurrency - the currency for which a rounding operator should be obtained,
not null.timestamp - the target UTC timestamp, when the rounding should be valid.null.public javax.money.MonetaryOperator getCustomRounding(java.lang.String customRoundingId)
javax.money.spi.RoundingProviderSpiMonetaryOperator for custom rounding
MonetaryAmount instances.getCustomRounding in interface javax.money.spi.RoundingProviderSpicustomRoundingId - The customRounding identifier.MonetaryOperator implementing the
rounding, or null.public java.util.Set<java.lang.String> getCustomRoundingIds()
javax.money.spi.RoundingProviderSpigetCustomRoundingIds in interface javax.money.spi.RoundingProviderSpinull.public javax.money.MonetaryOperator getRounding(javax.money.CurrencyUnit currency)
javax.money.spi.RoundingProviderSpiCurrencyUnit.
Instances of MonetaryOperator returned, must be thread safe and
immutable.
getRounding in interface javax.money.spi.RoundingProviderSpicurrency - the currency for which a rounding operator should be obtained,
not null.null.public javax.money.MonetaryOperator getRounding(javax.money.CurrencyUnit currency,
long timestamp)
javax.money.spi.RoundingProviderSpiCurrencyUnit, that was valid at
the given timestamp.
Instances of MonetaryOperator returned, must be thread safe and
immutable.
getRounding in interface javax.money.spi.RoundingProviderSpicurrency - the currency for which a rounding operator should be obtained,
not null.timestamp - the target UTC timestamp, when the rounding should be valid.null.public javax.money.MonetaryOperator getRounding(javax.money.MonetaryContext monetaryContext)
javax.money.spi.RoundingProviderSpiMonetaryContext.getRounding in interface javax.money.spi.RoundingProviderSpimonetaryContext - The target MonetaryContextnull