Top Description Fields Constructors Methods
javax.money.convert

public final Class ConversionContext

extends AbstractContext
Class Inheritance
Imports
javax.money.AbstractContext

This class models a context for which a ExchangeRate is valid. It allows to define different settings such as This class is immutable, thread-safe and serializable.
Author
Anatole Tresch

Field Summary

Modifier and TypeField and Description
public static final ConversionContext
ANY_CONVERSION

ConversionContext that queries any conversion available.

public static final ConversionContext
DEFERRED_CONVERSION

ConversionContext querying for any deferred rates.

public static final ConversionContext
HISTORIC_CONVERSION

ConversionContext querying for any historic rates.

public static final ConversionContext
OTHER_CONVERSION

ConversionContext querying for any other rates.

public static final ConversionContext
REALTIME_CONVERSION

ConversionContext querying for real-time rates.

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

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public static ConversionContext

Returns:

a corresponding instance of ConversionContext.
from
(ProviderContext
the provider context, not null.
providerContext
,
RateType
the rate type, not null.
rateType
)

Creates a new ConversionContext for the given ProviderContext and the given RateType.

public String

Returns:

the provider, or {code null}.
getProviderName
()

Overrides javax.money.AbstractContext.getProviderName.

Get the provider of this rate.
public RateType

Returns:

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

Get the deferred flag.

public static ConversionContext

Returns:

a new instance of ConversionContext
of
(String
the provider name, not null
provider
,
RateType
the required rate type.
rateType
)

Simple factory method for ConversionContext.

public static ConversionContext

Returns:

a new instance of ConversionContext
of
(RateType
the required rate type.
rateType
)

Creates a ConversionContext for accessing rates of the given type, without specifying the rate's provider.

public static ConversionContext

Returns:

a new instance of ConversionContext
of
()

Simple factory method for ConversionContext.

public ConversionContextBuilder

Returns:

a corresponding conversion query builder instance, never null.
toBuilder
()

Creates a conversion query builder with the context data from this context instance.

public ConversionQueryBuilder

Returns:

a new instance of ConversionQueryBuilder, never null.
toQueryBuilder
()

Creates a query builder based on this context.

Inherited from javax.money.AbstractContext:
equalsgetgetgetBooleangetDoublegetFloatgetIntgetKeysgetLonggetTextgetTypehashCodeisEmptytoString

Field Detail

ANY_CONVERSIONback to summary
public static final ConversionContext ANY_CONVERSION

ConversionContext that queries any conversion available.

DEFERRED_CONVERSIONback to summary
public static final ConversionContext DEFERRED_CONVERSION

ConversionContext querying for any deferred rates.

HISTORIC_CONVERSIONback to summary
public static final ConversionContext HISTORIC_CONVERSION

ConversionContext querying for any historic rates.

OTHER_CONVERSIONback to summary
public static final ConversionContext OTHER_CONVERSION

ConversionContext querying for any other rates.

REALTIME_CONVERSIONback to summary
public static final ConversionContext REALTIME_CONVERSION

ConversionContext querying for real-time rates.

serialVersionUIDback to summary
private static final long serialVersionUID

Hides javax.money.AbstractContext.serialVersionUID.

Constructor Detail

ConversionContextback to summary
pack-priv ConversionContext(ConversionContextBuilder builder)

Private constructor, used by javax.money.convert.ConversionContextBuilder.

Parameters
builder:ConversionContextBuilder

the Builder.

Method Detail

fromback to summary
public static ConversionContext from(ProviderContext providerContext, RateType rateType)

Creates a new ConversionContext for the given ProviderContext and the given RateType.

Note

for adding additional attributes use (ProviderContext, RateType).

Parameters
providerContext:ProviderContext

the provider context, not null.

rateType:RateType

the rate type, not null.

Returns:ConversionContext

a corresponding instance of ConversionContext.

getProviderNameback to summary
public String getProviderName()

Overrides javax.money.AbstractContext.getProviderName.

Get the provider of this rate. The provider of a rate can have different contexts in different usage scenarios, such as the service type or the stock exchange.

Returns:String

the provider, or {code null}.

getRateTypeback to summary
public RateType getRateType()

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

Returns:RateType

the deferred flag, or {code null}.

ofback to summary
public static ConversionContext of(String provider, RateType rateType)

Simple factory method for ConversionContext. For more possibilities to initialize a ConversionContext, please use a javax.money.convert.ConversionContextBuilder,

Parameters
provider:String

the provider name, not null

rateType:RateType

the required rate type.

Returns:ConversionContext

a new instance of ConversionContext

ofback to summary
public static ConversionContext of(RateType rateType)

Creates a ConversionContext for accessing rates of the given type, without specifying the rate's provider.

Parameters
rateType:RateType

the required rate type.

Returns:ConversionContext

a new instance of ConversionContext

ofback to summary
public static ConversionContext of()

Simple factory method for ConversionContext. For more possibilities to initialize a ConversionContext, please use a javax.money.convert.ConversionContextBuilder,

Returns:ConversionContext

a new instance of ConversionContext

toBuilderback to summary
public ConversionContextBuilder toBuilder()

Creates a conversion query builder with the context data from this context instance.

Returns:ConversionContextBuilder

a corresponding conversion query builder instance, never null.

toQueryBuilderback to summary
public ConversionQueryBuilder toQueryBuilder()

Creates a query builder based on this context.

Returns:ConversionQueryBuilder

a new instance of ConversionQueryBuilder, never null.