java.lang.Object
javax.money.AbstractContextBuilder<B,C>
javax.money.AbstractQueryBuilder<AmountFormatQueryBuilder,AmountFormatQuery>
javax.money.format.AmountFormatQueryBuilder
public final class AmountFormatQueryBuilder extends AbstractQueryBuilder<AmountFormatQueryBuilder,AmountFormatQuery>
Builder for queries for accessing/configuring
MonetaryAmountFormat
instances.
Note this class is NOT thread-safe.
-
Method Summary
Modifier and Type Method Description AmountFormatQuery
build()
Creates a newAmountFormatQuery
instance.static AmountFormatQueryBuilder
of(java.lang.String formatName)
Creates a newAmountFormatQueryBuilder
.static AmountFormatQueryBuilder
of(java.util.Locale locale)
Creates a new defaultAmountFormatQueryBuilder
for a formatter based on the locale specific defaults.static AmountFormatQueryBuilder
of(AmountFormatQuery formatQuery)
Creates a newAmountFormatQueryBuilder
and initializes it with the values fromformatQuery
.AmountFormatQueryBuilder
setFormatName(java.lang.String formatName)
Sets a style's id.AmountFormatQueryBuilder
setLocale(java.util.Locale locale)
Sets a Locale to be applied.AmountFormatQueryBuilder
setMonetaryAmountFactory(MonetaryAmountFactory<?> monetaryFactory)
Sets theMonetaryAmountFactory
to be used to of amounts during parsing.AmountFormatQueryBuilder
setMonetaryQuery(MonetaryAmountFactoryQuery monetaryQuery)
Sets theMonetaryContext
to be used, when amount's are parsed.Methods inherited from class javax.money.AbstractQueryBuilder
set, setProviderName, setProviderNames, setProviderNames, setTargetType
Methods inherited from class javax.money.AbstractContextBuilder
importContext, importContext, removeAttributes, set, set, set, set, set, set, set, set, set, toString
-
Method Details
-
setFormatName
Sets a style's id.- Parameters:
formatName
- the format's name, not null.- Returns:
- the Builder, for chaining.
-
setLocale
Sets a Locale to be applied.- Parameters:
locale
- the locale, not null.- Returns:
- the Builder, for chaining.
-
setMonetaryQuery
Sets theMonetaryContext
to be used, when amount's are parsed.- Parameters:
monetaryQuery
- the monetary query, notnull
.- Returns:
- this builder for chaining.
-
setMonetaryAmountFactory
Sets theMonetaryAmountFactory
to be used to of amounts during parsing.- Parameters:
monetaryFactory
- theMonetaryAmountFactory
to be used, not null.- Returns:
- this builder for chaining.
-
build
Creates a newAmountFormatQuery
instance.- Specified by:
build
in classAbstractQueryBuilder<AmountFormatQueryBuilder,AmountFormatQuery>
- Returns:
- a new
AmountFormatQuery
instance, never null.
-
of
Creates a newAmountFormatQueryBuilder
and initializes it with the values fromformatQuery
.- Parameters:
formatQuery
- the baseAmountFormatContext
, notnull
.- Returns:
- a new
AmountFormatQueryBuilder
instance, never null.
-
of
Creates a newAmountFormatQueryBuilder
.- Parameters:
formatName
- the target format's nameString
, notnull
.- Returns:
- a new
AmountFormatQueryBuilder
instance, never null.
-
of
Creates a new defaultAmountFormatQueryBuilder
for a formatter based on the locale specific defaults.- Parameters:
locale
- the targetLocale
, notnull
.- Returns:
- a new
AmountFormatQueryBuilder
instance, never null.
-