java.lang.Object
javax.money.AbstractContext
javax.money.AbstractQuery
javax.money.format.AmountFormatQuery
- All Implemented Interfaces:
java.io.Serializable
public final class AmountFormatQuery extends AbstractQuery
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:
- Serialized Form
-
Field Summary
Fields inherited from class javax.money.AbstractQuery
KEY_QUERY_PROVIDERS, KEY_QUERY_TARGET_TYPE, KEY_QUERY_TIMESTAMP
-
Method Summary
Modifier and Type Method Description java.lang.String
getFormatName()
Gets a style's id.java.util.Locale
getLocale()
Gets a Locale to be applied.MonetaryAmountFactory
getMonetaryAmountFactory()
Gets theMonetaryAmountFactoryQuery
to be used for accessing.MonetaryAmountFactory
, when amount's are parsed.static AmountFormatQuery
of(java.util.Locale locale, java.lang.String... providers)
Creates a simple format query based on a single Locale, similar to(java.util.Locale)
.AmountFormatQueryBuilder
toBuilder()
Get aAmountFormatQueryBuilder
preinitialized with this context instance.
-
Method Details
-
getFormatName
public java.lang.String getFormatName()Gets a style's id.- Returns:
- the styleId, or null.
-
getLocale
public java.util.Locale getLocale()Gets a Locale to be applied.- Returns:
- the style's locale, or null.
-
getMonetaryAmountFactory
Gets theMonetaryAmountFactoryQuery
to 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 aAmountFormatQueryBuilder
preinitialized with this context instance.- Returns:
- a new preinitialized builder, never null.
-