public final class ConversionContext extends AbstractContext
ExchangeRate is valid. It allows to define
different settings such as
RateType, | Modifier and Type | Field and Description |
|---|---|
static ConversionContext |
ANY_CONVERSION
ConversionContext that queries any conversion available.
|
static ConversionContext |
DEFERRED_CONVERSION
ConversionContext quering for any deferred rates.
|
static ConversionContext |
HISTORIC_CONVERSION
ConversionContext quering for any historic rates.
|
static ConversionContext |
OTHER_CONVERSION
ConversionContext quering for any other rates.
|
static ConversionContext |
REALTIME_CONVERSION
ConversionContext quering for real-time rates.
|
KEY_PROVIDER| Modifier and Type | Method and Description |
|---|---|
static ConversionContext |
from(ProviderContext providerContext,
RateType rateType)
Creates a new ConversionContext for the given
ProviderContext and the given RateType. |
String |
getProviderName()
Get the provider of this rate.
|
RateType |
getRateType()
Get the deferred flag.
|
static ConversionContext |
of()
Simple factory method for
ConversionContext. |
static ConversionContext |
of(RateType rateType)
Creates a
ConversionContext for accessing rates of the given
type, without specifying the rate's provider. |
static ConversionContext |
of(String provider,
RateType rateType)
Simple factory method for
ConversionContext. |
ConversionContextBuilder |
toBuilder()
Creates a conversion query builder with the context data from this context instance.
|
ConversionQueryBuilder |
toQueryBuilder()
Creates a query builder based on this onctex.
|
public static final ConversionContext ANY_CONVERSION
public static final ConversionContext DEFERRED_CONVERSION
public static final ConversionContext HISTORIC_CONVERSION
public static final ConversionContext REALTIME_CONVERSION
public static final ConversionContext OTHER_CONVERSION
public RateType getRateType()
public String getProviderName()
getProviderName in class AbstractContextpublic ConversionContextBuilder toBuilder()
public ConversionQueryBuilder toQueryBuilder()
ConversionQueryBuilder, never null.public static ConversionContext of(String provider, RateType rateType)
ConversionContext. For more
possibilities to initialize a ConversionContext, please use a
ConversionContextBuilder,provider - the provider name, not nullrateType - the required rate type.ConversionContextpublic static ConversionContext from(ProviderContext providerContext, RateType rateType)
ProviderContext and the given RateType.
Note: for adding additional attributes use (ProviderContext, RateType).
providerContext - the provider context, not null.rateType - the rate type, not null.public static ConversionContext of(RateType rateType)
ConversionContext for accessing rates of the given
type, without specifying the rate's provider.rateType - the required rate type.ConversionContextpublic static ConversionContext of()
ConversionContext. For more
possibilities to initialize a ConversionContext, please use a
ConversionContextBuilder,ConversionContextCopyright © 2012–2016 JSR 354 - Expert Group. All rights reserved.