- 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 ofCurrencyContextadding detailed information about aCurrencyUnitinstance. Typically the contexts are created and assigned by the classes that implement theCurrencyProviderSpi. The according implementation classes should document, which attributes are available.Note this class is NOT thread-safe.
- See Also:
CurrencyUnit.getContext()
-
-
Field Summary
-
Fields inherited from class javax.money.AbstractContextBuilder
data
-
-
Constructor Summary
Constructors Modifier Constructor Description privateCurrencyContextBuilder(java.lang.String provider)Creates a new builder.privateCurrencyContextBuilder(CurrencyContext context)Creates a new builder.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CurrencyContextbuild()Creates a new instance ofCurrencyContext.static CurrencyContextBuilderof(java.lang.String provider)Creates a new builder.static CurrencyContextBuilderof(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
-
-
-
-
Constructor Detail
-
CurrencyContextBuilder
private CurrencyContextBuilder(java.lang.String provider)
Creates a new builder.- Parameters:
provider- the provider name, creating the correspondingCurrencyUnitcontaining the finalCurrencyContextcreated by this builder, not null.
-
CurrencyContextBuilder
private CurrencyContextBuilder(CurrencyContext context)
Creates a new builder.- Parameters:
context- theCurrencyContextto be used for initializing this builder.
-
-
Method Detail
-
build
public CurrencyContext build()
Creates a new instance ofCurrencyContext.- Specified by:
buildin classAbstractContextBuilder<CurrencyContextBuilder,CurrencyContext>- Returns:
- a new
CurrencyContextinstance.
-
of
public static CurrencyContextBuilder of(java.lang.String provider)
Creates a new builder.- Parameters:
provider- the provider name, creating the correspondingCurrencyUnitcontaining the finalCurrencyContextcreated by this builder, not null.- Returns:
- a new
CurrencyContextBuilderinstance, never null.
-
of
public static CurrencyContextBuilder of(CurrencyContext context)
Creates a new builder.- Parameters:
context- theCurrencyContextto be used for initializing this builder.- Returns:
- a new
CurrencyContextBuilderinstance, never null.
-
-