java.lang.Object
javax.money.AbstractContext
javax.money.convert.ProviderContext
- All Implemented Interfaces:
Serializable
This class describes what kind of
ExchangeRates a .ExchangeRateProvider delivers, including the provider's name, rate type and additional data.
By default such a context supports the following attributes:
- a unique non localizable provider name. This provider name is also used to identify a concrete instance of ExchangeRateProvider.
- a set of
RateTypean ExchangeRateProvider supports - a time range for which an ExchangeRateProvider delivers rates.
Instances of this class are immutable and thread-safe.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final StringKey used for the rate types attribute.private static final longFields inherited from class javax.money.AbstractContext
KEY_PROVIDER -
Constructor Summary
ConstructorsConstructorDescriptionProviderContext(ProviderContextBuilder builder) Private constructor, used byProviderContextBuilder. -
Method Summary
Modifier and TypeMethodDescriptionGet the deferred flag.static ProviderContextCreates a new ProviderContext based on the provider id and rate type(s).static ProviderContextCreates a new ProviderContext based on the provider id and rate type(s).Creates aProviderContextBuilderinitialized with this instance's data.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
KEY_RATE_TYPES
Key used for the rate types attribute.- See Also:
-
-
Constructor Details
-
ProviderContext
ProviderContext(ProviderContextBuilder builder) Private constructor, used byProviderContextBuilder.- Parameters:
builder- the Builder.
-
-
Method Details
-
getRateTypes
Get the deferred flag. Exchange rates can be deferred or real.time.- Returns:
- the deferred flag, or {code null}.
-
toBuilder
Creates aProviderContextBuilderinitialized with this instance's data.- Returns:
- a new
ProviderContextBuilder, nevernull.
-
of
Creates a new ProviderContext based on the provider id and rate type(s).- Parameters:
provider- the provider id, not null.rateType- the requiredRateType, not null.rateTypes- the requiredRateTypes, not null- Returns:
- a new
ProviderContextinstance.
-
of
Creates a new ProviderContext based on the provider id and rate type(s).- Parameters:
provider- the provider id, not null.- Returns:
- a new
ProviderContextinstance.
-