- java.lang.Object
-
- javax.money.AbstractContext
-
- javax.money.CurrencyContext
-
- All Implemented Interfaces:
java.io.Serializable
public final class CurrencyContext extends AbstractContext implements java.io.Serializable
This class models the attributable context ofCurrencyUnitinstances. It provides information about- the provider that provided the instance (required)
- the target timestamp / temporal unit
- any other attributes, identified by the attribute type, e.g. regions, tenants etc.
Instances of this class must be created using the
CurrencyContextBuilder. Typically the contexts are created and assigned by the classes that implement theCurrencyProviderSpi. The according implementation classes should document, which attributes are available.This class is immutable, serializable and thread-safe.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static longserialVersionUID-
Fields inherited from class javax.money.AbstractContext
data, KEY_PROVIDER
-
-
Constructor Summary
Constructors Constructor Description CurrencyContext(CurrencyContextBuilder builder)Constructor, used from theCurrencyContextBuilder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CurrencyContextBuildertoBuilder()Allows to convert a instance into the correspondingCurrencyContextBuilder, which allows to change the values and of anotherCurrencyContextinstance.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CurrencyContext
CurrencyContext(CurrencyContextBuilder builder)
Constructor, used from theCurrencyContextBuilder.- Parameters:
builder- the corresponding builder, not null.
-
-
Method Detail
-
toBuilder
public CurrencyContextBuilder toBuilder()
Allows to convert a instance into the correspondingCurrencyContextBuilder, which allows to change the values and of anotherCurrencyContextinstance.- Returns:
- a new Builder instance, preinitialized with the values from this instance.
-
-