java.lang.Object
javax.money.AbstractContext
javax.money.AbstractQuery
javax.money.format.AmountFormatQuery
- All Implemented Interfaces:
Serializable
Query for accessing instances of
MonetaryAmountFormat. In general it is determined by the
implementation, what formats are provided. Nevertheless the following queries must be supported:
- Accessing a format based on a Locale, that is also supported by
.DecimalFormat#getAvailableLocales().
This class is immutable, thread-safe and serializable.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final StringKey used for the format name attribute.private static final longFields inherited from class javax.money.AbstractQuery
KEY_QUERY_PROVIDERS, KEY_QUERY_TARGET_TYPE, KEY_QUERY_TIMESTAMPFields inherited from class javax.money.AbstractContext
KEY_PROVIDER -
Constructor Summary
ConstructorsConstructorDescriptionConstructor, used from the Builder. -
Method Summary
Modifier and TypeMethodDescriptionGets a style's id.Gets a Locale to be applied.Gets theMonetaryAmountFactoryQueryto be used for accessing.MonetaryAmountFactory, when amount's are parsed.static AmountFormatQueryCreates a simple format query based on a single Locale, similar to(java.util.Locale).Get aAmountFormatQueryBuilderpreinitialized with this context instance.Methods inherited from class javax.money.AbstractQuery
getProviderNames, getTargetType
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
KEY_QUERY_FORMAT_NAME
Key used for the format name attribute.- See Also:
-
-
Constructor Details
-
AmountFormatQuery
AmountFormatQuery(AmountFormatQueryBuilder builder) Constructor, used from the Builder.- Parameters:
builder- the correspondingAmountFormatQueryBuilder, not null.
-
-
Method Details
-
getFormatName
Gets a style's id.- Returns:
- the styleId, or null.
-
getLocale
Gets a Locale to be applied.- Returns:
- the style's locale, or null.
-
getMonetaryAmountFactory
Gets theMonetaryAmountFactoryQueryto be used for accessing.MonetaryAmountFactory, when amount's are parsed.- Returns:
- the monetary context, or
null.
-
of
Creates a simple format query based on a single Locale, similar to(java.util.Locale).- Parameters:
locale- the target locale, not null.providers- the providers to be used, not null.- Returns:
- a new query instance
-
toBuilder
Get aAmountFormatQueryBuilderpreinitialized with this context instance.- Returns:
- a new preinitialized builder, never null.
-