public interface MonetaryAmountsSingletonQuerySpi
Monetary
singleton, implementing
the query functionality for amounts.Modifier and Type | Method and Description |
---|---|
Collection<MonetaryAmountFactory<? extends MonetaryAmount>> |
getAmountFactories(MonetaryAmountFactoryQuery query)
Get the
MonetaryAmountFactory implementation class, that best matches to cover the given
MonetaryContext . |
default MonetaryAmountFactory |
getAmountFactory(MonetaryAmountFactoryQuery query)
Executes the query and returns the
MonetaryAmountFactory implementation type found,
if there is only one type. |
default Class<? extends MonetaryAmount> |
getAmountType(MonetaryAmountFactoryQuery query)
Executes the query and returns the
MonetaryAmount implementation type found,
if there is only one type. |
default Collection<Class<? extends MonetaryAmount>> |
getAmountTypes(MonetaryAmountFactoryQuery query)
Executes the query and returns the
MonetaryAmount implementation types found. |
default boolean |
isAvailable(MonetaryAmountFactoryQuery query)
Checks if an
MonetaryAmountFactory is matching the given query. |
Collection<MonetaryAmountFactory<? extends MonetaryAmount>> getAmountFactories(MonetaryAmountFactoryQuery query)
MonetaryAmountFactory
implementation class, that best matches to cover the given
MonetaryContext
.
The evaluation order should consider the following aspects:
MonetaryContext.getAmountType()
is explicitly defined, it should be considered.
Nevertheless if precision/scale cannot be met, a MonetaryException
should
be thrown.
precision==0
(unlimited precision), the
MonetaryAmount
implementation candidate should be chosen with highest possible
precision.
Flavor.PERFORMANCE
are preferred.
MonetaryAmount
implementation class, that best matches to cover the given
MonetaryContext
, never null
.MonetaryException
- if no MonetaryAmount
implementation class can cover
the required
MonetaryContext
.default boolean isAvailable(MonetaryAmountFactoryQuery query)
MonetaryAmountFactory
is matching the given query.query
- the factory query, not null.MonetaryAmountFactory
matches the query.default Class<? extends MonetaryAmount> getAmountType(MonetaryAmountFactoryQuery query)
MonetaryAmount
implementation type found,
if there is only one type.
If multiple types match the query, the first one is selected.query
- the factory query, not null.default Collection<Class<? extends MonetaryAmount>> getAmountTypes(MonetaryAmountFactoryQuery query)
MonetaryAmount
implementation types found.query
- the factory query, not null.default MonetaryAmountFactory getAmountFactory(MonetaryAmountFactoryQuery query)
MonetaryAmountFactory
implementation type found,
if there is only one type. If multiple types match the query, the first one is selected.query
- the factory query, not null.Copyright © 2012–2016 JSR 354 - Expert Group. All rights reserved.