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:
()
-
Method Summary
Modifier and Type Method Description RoundingContextbuild()Creates a new instance ofRoundingContext.static RoundingContextBuilderof(java.lang.String provider, java.lang.String roundingId)Creates a new RoundingContextBuilder.static RoundingContextBuilderof(RoundingContext roundingContext)Creates a new RoundingContextBuilder.RoundingContextBuildersetCurrency(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
-
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.
-