java.lang.Object
javax.money.AbstractContextBuilder<CurrencyContextBuilder,CurrencyContext>
javax.money.CurrencyContextBuilder
public final class CurrencyContextBuilder extends AbstractContextBuilder<CurrencyContextBuilder,CurrencyContext>
Builder class for creating new instances of
CurrencyContext
adding detailed information
about a CurrencyUnit
instance. Typically the
contexts are created and assigned by the classes that implement the CurrencyProviderSpi
.
The according implementation classes should document, which attributes are available.
Note this class is NOT thread-safe.
- See Also:
CurrencyUnit.getContext()
-
Method Summary
Modifier and Type Method Description CurrencyContext
build()
Creates a new instance ofCurrencyContext
.static CurrencyContextBuilder
of(java.lang.String provider)
Creates a new builder.static CurrencyContextBuilder
of(CurrencyContext context)
Creates a new builder.Methods inherited from class javax.money.AbstractContextBuilder
importContext, importContext, removeAttributes, set, set, set, set, set, set, set, set, set, setProviderName, toString
-
Method Details
-
build
Creates a new instance ofCurrencyContext
.- Specified by:
build
in classAbstractContextBuilder<CurrencyContextBuilder,CurrencyContext>
- Returns:
- a new
CurrencyContext
instance.
-
of
Creates a new builder.- Parameters:
provider
- the provider name, creating the correspondingCurrencyUnit
containing the finalCurrencyContext
created by this builder, not null.- Returns:
- a new
CurrencyContextBuilder
instance, never null.
-
of
Creates a new builder.- Parameters:
context
- theCurrencyContext
to be used for initializing this builder.- Returns:
- a new
CurrencyContextBuilder
instance, never null.
-