Top Description Fields Constructors Methods
javax.money

public final Class MonetaryContextBuilder

extends AbstractContextBuilder<MonetaryContextBuilder, MonetaryContext>
Class Inheritance

Builder class for creating new instances of MonetaryContext adding detailed information about a MonetaryAmount instance.

Note this class is NOT thread-safe.

See Also
javax.money.MonetaryAmount#getContext()

Field Summary

Inherited from javax.money.AbstractContextBuilder:
data

Constructor Summary

AccessConstructor and Description
private
private
MonetaryContextBuilder(Class<? extends MonetaryAmount>
the target amount type, not null.
amountType
)

Creates a new builder, hereby the target implementation type is required.

Method Summary

Modifier and TypeMethod and Description
public MonetaryContext

Returns:

a new MonetaryAmountFactoryQuery instance.
build
()

Implements abstract javax.money.AbstractContextBuilder.build.

Creates a new instance of MonetaryAmountFactoryQuery.
public static MonetaryContextBuilder

Returns:

a new javax.money.MonetaryContextBuilder instance, never null.
of
()

Creates a new builder, hereby the target implementation type is required.

public static MonetaryContextBuilder

Returns:

a new javax.money.MonetaryContextBuilder instance, never null.
of
(MonetaryContext monetaryContext)

Creates a new builder, using an existing javax.money.MonetaryContext as a template.

public static MonetaryContextBuilder

Returns:

a new javax.money.MonetaryContextBuilder instance, never null.
of
(Class<? extends MonetaryAmount>
the target amount type, not null.
amountType
)

Creates a new builder, hereby the target implementation type is required.

public MonetaryContextBuilder

Returns:

the implementation class of the containing amount instance, never null.
setAmountType
(Class<? extends MonetaryAmount>
the target amount type, not null.
amountType
)

Set the MonetaryAmount implementation class.

public MonetaryContextBuilder

Returns:

this builder for chaining.
setFixedScale
(boolean
the fixed scale flag.
fixedScale
)

Set the flag if the scale should fixed.

public MonetaryContextBuilder

Returns:

this builder for chaining.
setMaxScale
(int
the max scale, >= 0.
maxScale
)

Set the maximal scale to be supported.

public MonetaryContextBuilder

Returns:

this builder for chaining.
setPrecision
(int
the precision, >= 0, 0 meaning unlimited.
precision
)

Set the required precision.

Inherited from javax.money.AbstractContextBuilder:
importContextimportContextremoveAttributessetsetsetsetsetsetsetsetsetsetProviderNametoString

Constructor Detail

MonetaryContextBuilderback to summary
private MonetaryContextBuilder(MonetaryContext monetaryContext)
MonetaryContextBuilderback to summary
private MonetaryContextBuilder(Class<? extends MonetaryAmount> amountType)

Creates a new builder, hereby the target implementation type is required. This can be used to explicitly acquire a specific amount type and additionally configure the amount factory with the attributes in this query.

Parameters
amountType:Class<? extends MonetaryAmount>

the target amount type, not null.

Method Detail

buildback to summary
public MonetaryContext build()

Implements abstract javax.money.AbstractContextBuilder.build.

Creates a new instance of MonetaryAmountFactoryQuery.

Returns:MonetaryContext

a new MonetaryAmountFactoryQuery instance.

ofback to summary
public static MonetaryContextBuilder of()

Creates a new builder, hereby the target implementation type is required. This can be used to explicitly acquire a specific amount type and additionally configure the amount factory with the attributes in this query.

Returns:MonetaryContextBuilder

a new javax.money.MonetaryContextBuilder instance, never null.

ofback to summary
public static MonetaryContextBuilder of(MonetaryContext monetaryContext)

Creates a new builder, using an existing javax.money.MonetaryContext as a template.

Returns:MonetaryContextBuilder

a new javax.money.MonetaryContextBuilder instance, never null.

ofback to summary
public static MonetaryContextBuilder of(Class<? extends MonetaryAmount> amountType)

Creates a new builder, hereby the target implementation type is required. This can be used to explicitly acquire a specific amount type and additionally configure the amount factory with the attributes in this query.

Parameters
amountType:Class<? extends MonetaryAmount>

the target amount type, not null.

Returns:MonetaryContextBuilder

a new javax.money.MonetaryContextBuilder instance, never null.

setAmountTypeback to summary
public MonetaryContextBuilder setAmountType(Class<? extends MonetaryAmount> amountType)

Set the MonetaryAmount implementation class.

Parameters
amountType:Class<? extends MonetaryAmount>

the target amount type, not null.

Returns:MonetaryContextBuilder

the implementation class of the containing amount instance, never null.

See Also
javax.money.MonetaryAmount#getContext()
setFixedScaleback to summary
public MonetaryContextBuilder setFixedScale(boolean fixedScale)

Set the flag if the scale should fixed.

Parameters
fixedScale:boolean

the fixed scale flag.

Returns:MonetaryContextBuilder

this builder for chaining.

setMaxScaleback to summary
public MonetaryContextBuilder setMaxScale(int maxScale)

Set the maximal scale to be supported.

Parameters
maxScale:int

the max scale, >= 0.

Returns:MonetaryContextBuilder

this builder for chaining.

setPrecisionback to summary
public MonetaryContextBuilder setPrecision(int precision)

Set the required precision.

Parameters
precision:int

the precision, >= 0, 0 meaning unlimited.

Returns:MonetaryContextBuilder

this builder for chaining.