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 AmountFormatQuerybuild()Creates a newAmountFormatQueryinstance.static AmountFormatQueryBuilderof(java.lang.String formatName)Creates a newAmountFormatQueryBuilder.static AmountFormatQueryBuilderof(java.util.Locale locale)Creates a new defaultAmountFormatQueryBuilderfor a formatter based on the locale specific defaults.static AmountFormatQueryBuilderof(AmountFormatQuery formatQuery)Creates a newAmountFormatQueryBuilderand initializes it with the values fromformatQuery.AmountFormatQueryBuildersetFormatName(java.lang.String formatName)Sets a style's id.AmountFormatQueryBuildersetLocale(java.util.Locale locale)Sets a Locale to be applied.AmountFormatQueryBuildersetMonetaryAmountFactory(MonetaryAmountFactory<?> monetaryFactory)Sets theMonetaryAmountFactoryto be used to of amounts during parsing.AmountFormatQueryBuildersetMonetaryQuery(MonetaryAmountFactoryQuery monetaryQuery)Sets theMonetaryContextto be used, when amount's are parsed.Methods inherited from class javax.money.AbstractQueryBuilder
set, setProviderName, setProviderNames, setProviderNames, setTargetTypeMethods 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 theMonetaryContextto be used, when amount's are parsed.- Parameters:
monetaryQuery- the monetary query, notnull.- Returns:
- this builder for chaining.
-
setMonetaryAmountFactory
Sets theMonetaryAmountFactoryto be used to of amounts during parsing.- Parameters:
monetaryFactory- theMonetaryAmountFactoryto be used, not null.- Returns:
- this builder for chaining.
-
build
Creates a newAmountFormatQueryinstance.- Specified by:
buildin classAbstractQueryBuilder<AmountFormatQueryBuilder,AmountFormatQuery>- Returns:
- a new
AmountFormatQueryinstance, never null.
-
of
Creates a newAmountFormatQueryBuilderand initializes it with the values fromformatQuery.- Parameters:
formatQuery- the baseAmountFormatContext, notnull.- Returns:
- a new
AmountFormatQueryBuilderinstance, never null.
-
of
Creates a newAmountFormatQueryBuilder.- Parameters:
formatName- the target format's nameString, notnull.- Returns:
- a new
AmountFormatQueryBuilderinstance, never null.
-
of
Creates a new defaultAmountFormatQueryBuilderfor a formatter based on the locale specific defaults.- Parameters:
locale- the targetLocale, notnull.- Returns:
- a new
AmountFormatQueryBuilderinstance, never null.
-