public interface MonetaryRoundingsSingletonSpi
MonetaryOperator
.
This class is thread-safe.
Modifier and Type | Method and Description |
---|---|
List<String> |
getDefaultProviderChain()
Access a list of the currently registered default providers.
|
MonetaryRounding |
getDefaultRounding()
Creates a
MonetaryRounding that can be added as MonetaryOperator to
chained calculations. |
Set<String> |
getProviderNames()
Allows to access the names of the current registered rounding providers.
|
default MonetaryRounding |
getRounding(CurrencyUnit currencyUnit,
String... providers)
Access a
MonetaryRounding for rounding MonetaryAmount
instances given a currency. |
default MonetaryRounding |
getRounding(RoundingQuery query)
Query a specific rounding with the given query.
|
default MonetaryRounding |
getRounding(String roundingName,
String... providers)
Access a
MonetaryRounding using the rounding name. |
Set<String> |
getRoundingNames(String... providers)
Allows to access the names of the current defined roundings.
|
Collection<MonetaryRounding> |
getRoundings(RoundingQuery query)
Execute a query for
MonetaryRounding . |
default boolean |
isRoundingAvailable(CurrencyUnit currencyUnit,
String... providers)
Checks if a
MonetaryRounding is available given a CurrencyUnit . |
default boolean |
isRoundingAvailable(RoundingQuery query)
Checks if any
MonetaryRounding is matching the given query. |
default boolean |
isRoundingAvailable(String roundingId,
String... providers)
Checks if a
MonetaryRounding is available given a roundingId. |
Set<String> getRoundingNames(String... providers)
providers
- the providers and ordering to be used. By default providers and ordering as defined in
#getDefaultProviders is used.null
.Set<String> getProviderNames()
null
.List<String> getDefaultProviderChain()
javamoney.properties
is used.RoundingQueryBuilder
Collection<MonetaryRounding> getRoundings(RoundingQuery query)
MonetaryRounding
. This allows to model more complex used cases,
such as historic or special roundings.query
- the query to be expected, not null.MonetaryRounding getDefaultRounding()
MonetaryRounding
that can be added as MonetaryOperator
to
chained calculations. The instance must lookup the concrete
MonetaryRounding
instance from the MonetaryRoundingsSingletonSpi
based on the input MonetaryAmount
's CurrencyUnit
.default MonetaryRounding getRounding(CurrencyUnit currencyUnit, String... providers)
MonetaryRounding
for rounding MonetaryAmount
instances given a currency.currencyUnit
- The currency, which determines the required precision. As
RoundingMode
, by default, RoundingMode.HALF_UP
is sued.providers
- the optional provider list and ordering to be usedMonetaryOperator
implementing the
rounding, never null
.MonetaryException
- if no such rounding could be provided.default MonetaryRounding getRounding(String roundingName, String... providers)
MonetaryRounding
using the rounding name.roundingName
- The rounding name, not null.providers
- the optional provider list and ordering to be usedMonetaryOperator
implementing the
rounding, never null
.IllegalArgumentException
- if no such rounding is registered using a
RoundingProviderSpi
instance.default MonetaryRounding getRounding(RoundingQuery query)
AbstractQuery.getProviderNames()
.query
- the rounding query, not null.default boolean isRoundingAvailable(RoundingQuery query)
MonetaryRounding
is matching the given query.query
- the rounding query, not null.default boolean isRoundingAvailable(String roundingId, String... providers)
MonetaryRounding
is available given a roundingId.roundingId
- The rounding identifier.providers
- the providers and ordering to be used. By default providers and ordering as defined in
#getDefaultProviders is used.MonetaryRounding
is available.IllegalArgumentException
- if no such rounding is registered using a
RoundingProviderSpi
instance.default boolean isRoundingAvailable(CurrencyUnit currencyUnit, String... providers)
MonetaryRounding
is available given a CurrencyUnit
.currencyUnit
- The currency, which determines the required precision. As RoundingMode
,
by default, RoundingMode.HALF_UP
is used.providers
- the providers and ordering to be used. By default providers and ordering as defined in
#getDefaultProviders is used.MonetaryRounding
is available.IllegalArgumentException
- if no such rounding is registered using a
RoundingProviderSpi
instance.Copyright © 2012–2016 JSR 354 - Expert Group. All rights reserved.