Top Description Fields Constructors Methods
org.javamoney.moneta.format

public Class MonetaryAmountDecimalFormatBuilder

extends Object
Class Inheritance
Imports
org.javamoney.moneta.function.MonetaryAmountProducer, .MoneyProducer, javax.money.CurrencyUnit, .Monetary, javax.money.format.MonetaryAmountFormat, java.text.DecimalFormat, .DecimalFormatSymbols, .NumberFormat, java.util.Currency, .Locale, .Objects

Builder to MonetaryAmountFormat.
Since
1.0.1
See Also
MonetaryAmountDecimalFormatBuilder#newInstance, MonetaryAmountDecimalFormatBuilder#of

Field Summary

Modifier and TypeField and Description
private CurrencyUnit
private DecimalFormat
private Locale
private MonetaryAmountProducer

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public MonetaryAmountFormat
build()

Creates the MonetaryAmountFormat If @{link Locale} didn't set the default value is Locale#getDefault() If @{link MonetaryAmountProducer} didn't set the default value is MoneyProducer If @{link CurrencyUnit} didn't set the default value is a currency from Locale

public static MonetaryAmountDecimalFormatBuilder

Returns:

a new instance of MonetaryAmountDecimalFormatBuilder
newInstance
()

Creates a new instance of MonetaryAmountDecimalFormatBuilder with default Locale.

public static MonetaryAmountDecimalFormatBuilder

Returns:

a new instance of MonetaryAmountDecimalFormatBuilder
of
(Locale
the target locale
locale
)

Creates a new instance of MonetaryAmountDecimalFormatBuilder with Locale set from parameter.

public static MonetaryAmountDecimalFormatBuilder

Returns:

a new instance of MonetaryAmountDecimalFormatBuilder
of
(String
the pattern, not null.
pattern
)

Creates a new instance of MonetaryAmountDecimalFormatBuilder with default Locale and pattern to format the javax.money.MonetaryAmount.

public static MonetaryAmountDecimalFormatBuilder

Returns:

a new instance of MonetaryAmountDecimalFormatBuilder
of
(String
the pattern to be used
pattern
,
Locale
the target locale
locale
)

Creates a new instance of MonetaryAmountDecimalFormatBuilder with Locale set from parameter and pattern to format the javax.money.MonetaryAmount.

public MonetaryAmountDecimalFormatBuilder
withCurrencyUnit(CurrencyUnit
the target currency
currencyUnit
)

Sets the CurrencyUnit

public MonetaryAmountDecimalFormatBuilder
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

currencyUnitback to summary
private CurrencyUnit currencyUnit
decimalFormatback to summary
private DecimalFormat decimalFormat
localeback to summary
private Locale locale
producerback to summary
private MonetaryAmountProducer producer

Constructor Detail

MonetaryAmountDecimalFormatBuilderback to summary
private MonetaryAmountDecimalFormatBuilder()

Method Detail

buildback to summary
public MonetaryAmountFormat build()

Creates the MonetaryAmountFormat If @{link Locale} didn't set the default value is Locale#getDefault() If @{link MonetaryAmountProducer} didn't set the default value is MoneyProducer If @{link CurrencyUnit} didn't set the default value is a currency from Locale

Returns:MonetaryAmountFormat

MonetaryAmountFormat

newInstanceback to summary
public static MonetaryAmountDecimalFormatBuilder newInstance()

Creates a new instance of MonetaryAmountDecimalFormatBuilder with default Locale.

Returns:MonetaryAmountDecimalFormatBuilder

a new instance of MonetaryAmountDecimalFormatBuilder

See Also
NumberFormat#getCurrencyInstance()
ofback to summary
public static MonetaryAmountDecimalFormatBuilder of(Locale locale)

Creates a new instance of MonetaryAmountDecimalFormatBuilder with Locale set from parameter.

Parameters
locale:Locale

the target locale

Returns:MonetaryAmountDecimalFormatBuilder

a new instance of MonetaryAmountDecimalFormatBuilder

See Also
NumberFormat#getCurrencyInstance(Locale)
ofback to summary
public static MonetaryAmountDecimalFormatBuilder of(String pattern)

Creates a new instance of MonetaryAmountDecimalFormatBuilder with default Locale and pattern to format the javax.money.MonetaryAmount.

Parameters
pattern:String

the pattern, not null.

Returns:MonetaryAmountDecimalFormatBuilder

a new instance of MonetaryAmountDecimalFormatBuilder

See Also
DecimalFormat, DecimalFormat#DecimalFormat(String)
ofback to summary
public static MonetaryAmountDecimalFormatBuilder of(String pattern, Locale locale)

Creates a new instance of MonetaryAmountDecimalFormatBuilder with Locale set from parameter and pattern to format the javax.money.MonetaryAmount.

Parameters
pattern:String

the pattern to be used

locale:Locale

the target locale

Returns:MonetaryAmountDecimalFormatBuilder

a new instance of MonetaryAmountDecimalFormatBuilder

See Also
DecimalFormat, DecimalFormat#DecimalFormat(String)
withCurrencyUnitback to summary
public MonetaryAmountDecimalFormatBuilder withCurrencyUnit(CurrencyUnit currencyUnit)

Sets the CurrencyUnit

Parameters
currencyUnit:CurrencyUnit

the target currency

Returns:MonetaryAmountDecimalFormatBuilder

the MonetaryAmountDecimalFormatBuilder

withProducerback to summary
public MonetaryAmountDecimalFormatBuilder withProducer(MonetaryAmountProducer producer)

Sets the MonetaryAmountProducer

Parameters
producer:MonetaryAmountProducer

the producer

Returns:MonetaryAmountDecimalFormatBuilder

the MonetaryAmountDecimalFormatBuilder