- java.lang.Object
-
- javax.money.AbstractContext
-
- javax.money.AbstractQuery
-
- javax.money.MonetaryAmountFactoryQuery
-
- All Implemented Interfaces:
java.io.Serializable
public final class MonetaryAmountFactoryQuery extends AbstractQuery implements java.io.Serializable
Query to lookup instances ofMonetaryAmountFactory, which are determined by the (minimal) capabilities required by the give use case. By default amount factories can be queried by- The maximal scale needed (THE ADDITIONAL fixed scale allows to define the minimal an maximal scale to be the same).
- The maximal numeric precision required.
- the target
MonetaryAmountimplementation type. - any other attributes, currently supported by the current factory and query implementation registered.
This class is thread-safe, final and serializable.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringKEY_FIXED_SCALEKey name for the currency provider.private static java.lang.StringKEY_MAX_SCALEKey name for the max scale.private static java.lang.StringKEY_PRECISIONKey name for the context.private static longserialVersionUID-
Fields inherited from class javax.money.AbstractQuery
KEY_QUERY_PROVIDERS, KEY_QUERY_TARGET_TYPE, KEY_QUERY_TIMESTAMP
-
Fields inherited from class javax.money.AbstractContext
data, KEY_PROVIDER
-
-
Constructor Summary
Constructors Constructor Description MonetaryAmountFactoryQuery(MonetaryAmountFactoryQueryBuilder builder)Constructor, used from theMonetaryAmountFactoryQueryBuilder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.IntegergetMaxScale()Get the maximal scale to be supported.java.lang.IntegergetPrecision()Get the maximal precision to be supported.java.lang.BooleanisFixedScale()Get the fixed scale flag to be supported.MonetaryAmountFactoryQueryBuildertoBuilder()Creates a new builder instances, initialized with the data from this one.-
Methods inherited from class javax.money.AbstractQuery
getProviderNames, getTargetType
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
KEY_PRECISION
private static final java.lang.String KEY_PRECISION
Key name for the context.- See Also:
- Constant Field Values
-
KEY_FIXED_SCALE
private static final java.lang.String KEY_FIXED_SCALE
Key name for the currency provider.- See Also:
- Constant Field Values
-
KEY_MAX_SCALE
private static final java.lang.String KEY_MAX_SCALE
Key name for the max scale.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MonetaryAmountFactoryQuery
MonetaryAmountFactoryQuery(MonetaryAmountFactoryQueryBuilder builder)
Constructor, used from theMonetaryAmountFactoryQueryBuilder.- Parameters:
builder- the corresponding builder, not null.
-
-
Method Detail
-
getMaxScale
public java.lang.Integer getMaxScale()
Get the maximal scale to be supported.- Returns:
- the maximal scale, or null, if this attribute must not be considered.
-
getPrecision
public java.lang.Integer getPrecision()
Get the maximal precision to be supported.- Returns:
- the maximal precision, or null, if this attribute must not be considered.
-
isFixedScale
public java.lang.Boolean isFixedScale()
Get the fixed scale flag to be supported. A fixed scale hereby means that the scale is always equal to the max scale (it could never be less).- Returns:
- the fixed scale flag, or null, if this attribute must not be considered.
-
toBuilder
public MonetaryAmountFactoryQueryBuilder toBuilder()
Creates a new builder instances, initialized with the data from this one.- Returns:
- a new
MonetaryAmountFactoryQueryBuilderinstance, never null.
-
-