public final class MonetaryContextBuilder extends AbstractContextBuilder<MonetaryContextBuilder,MonetaryContext>
MonetaryContext adding detailed information
about a MonetaryAmount instance.
Note this class is NOT thread-safe.
MonetaryAmount.getContext()| Modifier and Type | Method and Description |
|---|---|
MonetaryContext |
build()
Creates a new instance of
MonetaryAmountFactoryQuery. |
static MonetaryContextBuilder |
of()
Creates a new builder, hereby the target implementation type is required.
|
static MonetaryContextBuilder |
of(Class<? extends MonetaryAmount> amountType)
Creates a new builder, hereby the target implementation type is required.
|
static MonetaryContextBuilder |
of(MonetaryContext monetaryContext)
Creates a new builder, using an existing
MonetaryContext as a template. |
MonetaryContextBuilder |
setAmountType(Class<? extends MonetaryAmount> amountType)
Set the MonetaryAmount implementation class.
|
MonetaryContextBuilder |
setFixedScale(boolean fixedScale)
Set the flag if the scale should fixed.
|
MonetaryContextBuilder |
setMaxScale(int maxScale)
Set the maximal scale to be supported.
|
MonetaryContextBuilder |
setPrecision(int precision)
Set the required precision.
|
importContext, importContext, removeAttributes, set, set, set, set, set, set, set, set, set, setProviderName, toStringpublic MonetaryContextBuilder setMaxScale(int maxScale)
maxScale - the max scale, >= 0.public MonetaryContextBuilder setPrecision(int precision)
precision - the precision, >= 0, 0 meaning unlimited.public MonetaryContextBuilder setFixedScale(boolean fixedScale)
fixedScale - the fixed scale flag.public MonetaryContextBuilder setAmountType(Class<? extends MonetaryAmount> amountType)
MonetaryAmount.getContext()public MonetaryContext build()
MonetaryAmountFactoryQuery.build in class AbstractContextBuilder<MonetaryContextBuilder,MonetaryContext>MonetaryAmountFactoryQuery instance.public static MonetaryContextBuilder of()
MonetaryContextBuilder instance, never null.public static MonetaryContextBuilder of(MonetaryContext monetaryContext)
MonetaryContext as a template.MonetaryContextBuilder instance, never null.public static MonetaryContextBuilder of(Class<? extends MonetaryAmount> amountType)
amountType - the target amount type, not null.MonetaryContextBuilder instance, never null.Copyright © 2012–2015 JSR 354 - Expert Group. All rights reserved.