java.lang.Object
javax.money.AbstractContextBuilder<RoundingContextBuilder,RoundingContext>
javax.money.RoundingContextBuilder
public final class RoundingContextBuilder
extends AbstractContextBuilder<RoundingContextBuilder,RoundingContext>
Builder class for creating new instances of
RoundingContext adding detailed information
about a MonetaryRounding instance.
Note this class is NOT thread-safe.
- See Also:
-
Field Summary
Fields inherited from class javax.money.AbstractContextBuilder
data -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateRoundingContextBuilder(String provider, String roundingId) Creates a new builder.privateRoundingContextBuilder(RoundingContext roundingContext) Creates a new RoundingContextBuilder. -
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates a new instance ofRoundingContext.static RoundingContextBuilderCreates a new RoundingContextBuilder.static RoundingContextBuilderof(RoundingContext roundingContext) Creates a new RoundingContextBuilder.setCurrency(CurrencyUnit currencyUnit) Get the basicCurrencyUnit, which is based for this rounding type.Methods inherited from class javax.money.AbstractContextBuilder
importContext, importContext, removeAttributes, set, set, set, set, set, set, set, set, set, setProviderName, toString
-
Constructor Details
-
RoundingContextBuilder
Creates a new builder.- Parameters:
provider- the provider name, creating the correspondingMonetaryRoundingcontaining, not null. the finalRoundingContextcreated by this builder, not null.roundingId- The name of the rounding, not null.
-
RoundingContextBuilder
Creates a new RoundingContextBuilder.- Parameters:
roundingContext- the rounding context, used as a template, not null.
-
-
Method Details
-
setCurrency
Get the basicCurrencyUnit, which is based for this rounding type.- Parameters:
currencyUnit- the target currency unit not null.- Returns:
- the target CurrencyUnit, or null.
-
build
Creates a new instance ofRoundingContext.- Specified by:
buildin classAbstractContextBuilder<RoundingContextBuilder,RoundingContext> - Returns:
- a new
RoundingContextinstance.
-
of
Creates a new RoundingContextBuilder.- Parameters:
provider- the provider name, creating the correspondingMonetaryRoundingcontaining, not null. the finalRoundingContextcreated by this builder, not null.roundingId- The name of the rounding, not null.- Returns:
- a new
MonetaryContextBuilderinstance, never null.
-
of
Creates a new RoundingContextBuilder.- Parameters:
roundingContext- the rounding context, used as a template, not null.- Returns:
- a new
MonetaryContextBuilderinstance, never null.
-