Top Description Fields Constructors Methods
javax.money.convert

public final Class ProviderContext

extends AbstractContext
Class Inheritance
Imports
java.util.Collections, .Set, javax.money.AbstractContext

This class describes what kind of javax.money.convert.ExchangeRates a .ExchangeRateProvider delivers, including the provider's name, rate type and additional data. By default such a context supports the following attributes: Additionally a instance of ProviderContext can have arbitrary additional attributes describing more precisely the capabilities of a concrete ExchangeRateProvider} implementation.

Instances of this class are immutable and thread-safe.

Authors
Anatole Tresch, Werner Keil

Field Summary

Modifier and TypeField and Description
pack-priv static final String
KEY_RATE_TYPES

Key used for the rate types attribute.

private static final long
Inherited from javax.money.AbstractContext:
KEY_PROVIDER

Constructor Summary

AccessConstructor and Description
pack-priv
ProviderContext(ProviderContextBuilder
the Builder.
builder
)

Private constructor, used by ProviderContextBuilder.

Method Summary

Modifier and TypeMethod and Description
public Set<RateType>

Returns:

the deferred flag, or {code null}.
getRateTypes
()

Get the deferred flag.

public static ProviderContext

Returns:

a new ProviderContext instance.
of
(String
the provider id, not null.
provider
,
RateType
the required RateType, not null.
rateType
,
RateType...
the required RateTypes, not null
rateTypes
)

Creates a new ProviderContext based on the provider id and rate type(s).

public static ProviderContext

Returns:

a new ProviderContext instance.
of
(String
the provider id, not null.
provider
)

Creates a new ProviderContext based on the provider id and rate type(s).

public ProviderContextBuilder

Returns:

a new ProviderContextBuilder, never null.
toBuilder
()

Creates a ProviderContextBuilder initialized with this instance's data.

Inherited from javax.money.AbstractContext:
equalsgetgetgetBooleangetDoublegetFloatgetIntgetKeysgetLonggetProviderNamegetTextgetTypehashCodeisEmptytoString

Field Detail

KEY_RATE_TYPESback to summary
pack-priv static final String KEY_RATE_TYPES

Key used for the rate types attribute.

serialVersionUIDback to summary
private static final long serialVersionUID

Hides javax.money.AbstractContext.serialVersionUID.

Constructor Detail

ProviderContextback to summary
pack-priv ProviderContext(ProviderContextBuilder builder)

Private constructor, used by ProviderContextBuilder.

Parameters
builder:ProviderContextBuilder

the Builder.

Method Detail

getRateTypesback to summary
public Set<RateType> getRateTypes()

Get the deferred flag. Exchange rates can be deferred or real.time.

Returns:Set<RateType>

the deferred flag, or {code null}.

ofback to summary
public static ProviderContext of(String provider, RateType rateType, RateType... rateTypes)

Creates a new ProviderContext based on the provider id and rate type(s).

Parameters
provider:String

the provider id, not null.

rateType:RateType

the required RateType, not null.

rateTypes:RateType[]

the required RateTypes, not null

Returns:ProviderContext

a new ProviderContext instance.

ofback to summary
public static ProviderContext of(String provider)

Creates a new ProviderContext based on the provider id and rate type(s).

Parameters
provider:String

the provider id, not null.

Returns:ProviderContext

a new ProviderContext instance.

toBuilderback to summary
public ProviderContextBuilder toBuilder()

Creates a ProviderContextBuilder initialized with this instance's data.

Returns:ProviderContextBuilder

a new ProviderContextBuilder, never null.