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 RoundingContext
build()
Creates a new instance ofRoundingContext
.static RoundingContextBuilder
of(java.lang.String provider, java.lang.String roundingId)
Creates a new RoundingContextBuilder.static RoundingContextBuilder
of(RoundingContext roundingContext)
Creates a new RoundingContextBuilder.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
-
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:
build
in classAbstractContextBuilder<RoundingContextBuilder,RoundingContext>
- Returns:
- a new
RoundingContext
instance.
-
of
Creates a new RoundingContextBuilder.- Parameters:
provider
- the provider name, creating the correspondingMonetaryRounding
containing, not null. the finalRoundingContext
created by this builder, not null.roundingId
- The name of the rounding, not null.- Returns:
- a new
MonetaryContextBuilder
instance, never null.
-
of
Creates a new RoundingContextBuilder.- Parameters:
roundingContext
- the rounding context, used as a template, not null.- Returns:
- a new
MonetaryContextBuilder
instance, never null.
-