java.lang.Object
javax.money.AbstractContextBuilder<ConversionContextBuilder,ConversionContext>
javax.money.convert.ConversionContextBuilder
public final class ConversionContextBuilder
extends AbstractContextBuilder<ConversionContextBuilder,ConversionContext>
Builder class to of
ConversionContext instances. Instances of
this class are not thread-safe.-
Constructor Summary
ConstructorsModifierConstructorDescriptionCreate a new Builder instance without any provider, e.g.privateCreate a new Builder, hereby using the givenConversionContext's values as defaults.privateConversionContextBuilder(ProviderContext context, RateType rateType) Create a new Builder, hereby using the givenConversionContext's values as defaults. -
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates a newConversionContextwith the data from this Builder instance.static ConversionContextBuildercreate(ProviderContext context, RateType rateType) Create a new Builder, hereby using the givenConversionContext's values as defaults.static ConversionContextBuilderof()Creates a newConversionContextBuilderinstance.static ConversionContextBuilderof(ConversionContext conversionContext) Creates a newConversionContextBuilderinstance.setRateType(RateType rateType) Set the historic value.Methods inherited from class javax.money.AbstractContextBuilder
importContext, importContext, removeAttributes, set, set, set, set, set, set, set, set, set, setProviderName, toString
-
Constructor Details
-
ConversionContextBuilder
Create a new Builder, hereby using the givenConversionContext's values as defaults. This allows changing an existingConversionContexteasily.- Parameters:
context- the context, notnull
-
ConversionContextBuilder
Create a new Builder, hereby using the givenConversionContext's values as defaults. This allows changing an existingConversionContexteasily.- Parameters:
context- the provider context, notnullrateType- the rate type, not null.
-
ConversionContextBuilder
public ConversionContextBuilder()Create a new Builder instance without any provider, e.g. for creating newConversionContextinstances for querying.
-
-
Method Details
-
setRateType
Set the historic value.- Parameters:
rateType- the rate type- Returns:
- this, for chaining.
-
build
Creates a newConversionContextwith the data from this Builder instance.- Specified by:
buildin classAbstractContextBuilder<ConversionContextBuilder,ConversionContext> - Returns:
- a new
ConversionContext. nevernull.
-
of
Creates a newConversionContextBuilderinstance.- Parameters:
conversionContext- the conversion context to be used to initialize the new builder instance, not null.- Returns:
- a new
ConversionContextBuilderinstance, never null.
-
of
Creates a newConversionContextBuilderinstance.- Returns:
- a new
ConversionContextBuilderinstance, never null.
-
create
Create a new Builder, hereby using the givenConversionContext's values as defaults. This allows changing an existingConversionContexteasily.- Parameters:
context- the provider context, notnullrateType- the rate type, not null.- Returns:
- a new
ConversionContextBuilderinstance, never null.
-