public final class MonetaryAmounts extends Object
MonetaryAmount
instances as provided by the different registered
MonetaryAmountFactory
instances.
This singleton allows to access MonetaryAmountFactory
instances for the registered
MonetaryAmount
implementation classes or using a flexible MonetaryAmountFactoryQuery
instance, determining the selection attributes arbitrarely.
Modifier and Type | Method and Description |
---|---|
static Collection<MonetaryAmountFactory<?>> |
getAmountFactories()
Access all currently available
MonetaryAmount implementation classes that are
accessible from this MonetaryAmount singleton. |
static Collection<MonetaryAmountFactory<?>> |
getAmountFactories(MonetaryAmountFactoryQuery query)
Returns all factory instances that match the query.
|
static <T extends MonetaryAmount> |
getAmountFactory(Class<T> amountType)
Access an
MonetaryAmountFactory for the given MonetaryAmount implementation
type. |
static MonetaryAmountFactory |
getAmountFactory(MonetaryAmountFactoryQuery query)
Executes the query and returns the factory found, if there is only one factory.
|
static Collection<Class<? extends MonetaryAmount>> |
getAmountTypes()
Access all currently available
MonetaryAmount implementation classes that are
accessible from this MonetaryAmount singleton. |
static MonetaryAmountFactory<?> |
getDefaultAmountFactory()
Access the default
MonetaryAmountFactory as defined by
MonetaryAmountsSingletonSpi.getDefaultAmountFactory() . |
static Class<? extends MonetaryAmount> |
getDefaultAmountType()
Access the default
MonetaryAmount implementation class that is
accessible from this MonetaryAmount singleton. |
static boolean |
isAvailable(MonetaryAmountFactoryQuery query)
Allows to check if any of the getXXX methods return non empty/non null results of
.MonetaryAmountFactory . |
public static <T extends MonetaryAmount> MonetaryAmountFactory<T> getAmountFactory(Class<T> amountType)
MonetaryAmountFactory
for the given MonetaryAmount
implementation
type.amountType
- MonetaryAmount
implementation type, nor null
.MonetaryAmountFactory
, never null
.MonetaryException
- if no MonetaryAmountFactory
targeting the given MonetaryAmount
implementation class is registered.public static MonetaryAmountFactory<?> getDefaultAmountFactory()
MonetaryAmountFactory
as defined by
MonetaryAmountsSingletonSpi.getDefaultAmountFactory()
.MonetaryAmountFactory
corresponding to default amount type,
never null
.MonetaryException
- if no MonetaryAmountFactory
targeting the default amount type
implementation class is registered.public static Collection<MonetaryAmountFactory<?>> getAmountFactories()
MonetaryAmount
implementation classes that are
accessible from this MonetaryAmount
singleton.MonetaryAmount
implementation classes that have
corresponding MonetaryAmountFactory
instances provided, never null
public static Collection<Class<? extends MonetaryAmount>> getAmountTypes()
MonetaryAmount
implementation classes that are
accessible from this MonetaryAmount
singleton.MonetaryAmount
implementation classes that have
corresponding MonetaryAmountFactory
instances provided, never null
public static Class<? extends MonetaryAmount> getDefaultAmountType()
MonetaryAmount
implementation class that is
accessible from this MonetaryAmount
singleton.MonetaryAmount
implementation class, never null
public static MonetaryAmountFactory getAmountFactory(MonetaryAmountFactoryQuery query)
query
- the factory query, not null.public static Collection<MonetaryAmountFactory<?>> getAmountFactories(MonetaryAmountFactoryQuery query)
query
- the factory query, not null.public static boolean isAvailable(MonetaryAmountFactoryQuery query)
.MonetaryAmountFactory
.query
- the factory query, not null.MonetaryAmountFactory
matches the query.Copyright © 2012–2015 JSR 354 - Expert Group. All rights reserved.