java.lang.Object
javax.money.AbstractContext
javax.money.CurrencyContext
- All Implemented Interfaces:
Serializable
This class models the attributable context of
CurrencyUnit instances. 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 the CurrencyProviderSpi.
The according implementation classes should document, which attributes are available.
This class is immutable, serializable and thread-safe.
- See Also:
-
Field Summary
FieldsFields inherited from class javax.money.AbstractContext
data, KEY_PROVIDER -
Constructor Summary
ConstructorsConstructorDescriptionCurrencyContext(CurrencyContextBuilder builder) Constructor, used from theCurrencyContextBuilder. -
Method Summary
Modifier and TypeMethodDescriptionAllows to convert a instance into the correspondingCurrencyContextBuilder, which allows to change the values and of anotherCurrencyContextinstance.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
-
Constructor Details
-
CurrencyContext
CurrencyContext(CurrencyContextBuilder builder) Constructor, used from theCurrencyContextBuilder.- Parameters:
builder- the corresponding builder, not null.
-
-
Method Details
-
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.
-