Top Description Fields Constructors Methods
org.javamoney.moneta.spi

public Class CompoundRateProvider

extends AbstractRateProvider
Class Inheritance
Imports
javax.money.convert.ConversionQuery, .CurrencyConversionException, .ExchangeRate, .ExchangeRateProvider, .ProviderContext, .ProviderContextBuilder, .RateType, java.util.ArrayList, .HashSet, .List, .Objects, .Optional, .Set, java.util.logging.Logger

This class implements a ExchangeRateProvider that delegates calls to a collection of child ExchangeRateProvider instance.
Author
Anatole Tresch

Field Summary

Modifier and TypeField and Description
public static final String
CHILD_PROVIDER_CONTEXTS_KEY

Deprecated Will be private in next major release.
Key used to store a list of child javax.money.convert.ProviderContext instances of the providers contained within this instance.
private static final Logger
private final List<ExchangeRateProvider>
Inherited from org.javamoney.moneta.spi.AbstractRateProvider:
log

Constructor Summary

AccessConstructor and Description
public
CompoundRateProvider(Iterable<ExchangeRateProvider>
The collection of child ExchangeRateProvider instances this class delegates calls to.
providers
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
private void
addProvider(ExchangeRateProvider
The ExchangeRateProvider to be added, not null .
prov
)

Add an additional ExchangeRateProvider to the instance's delegate list.

private static ProviderContext
public ExchangeRate
public ExchangeRate
getExchangeRate(ConversionQuery conversionQuery, boolean failFast)

Inherited from org.javamoney.moneta.spi.AbstractRateProvider:
dividedividegetContextgetCurrencyConversiongetExchangeContextgetQueryDatesgetScalemultiply

Field Detail

CHILD_PROVIDER_CONTEXTS_KEYback to summary
public static final String CHILD_PROVIDER_CONTEXTS_KEY

Deprecated

Will be private in next major release.

Key used to store a list of child javax.money.convert.ProviderContext instances of the providers contained within this instance.

Annotations
@Deprecated
loggerback to summary
private static final Logger logger
providersback to summary
private final List<ExchangeRateProvider> providers

The ExchangeRateProvider instances.

Constructor Detail

CompoundRateProviderback to summary
public CompoundRateProvider(Iterable<ExchangeRateProvider> providers)

Constructor.

Parameters
providers:Iterable<ExchangeRateProvider>

The collection of child ExchangeRateProvider instances this class delegates calls to.

Method Detail

addProviderback to summary
private void addProvider(ExchangeRateProvider prov)

Add an additional ExchangeRateProvider to the instance's delegate list.

Parameters
prov:ExchangeRateProvider

The ExchangeRateProvider to be added, not null .

Exceptions
NullPointerException:
if the provider is null. .
createContextback to summary
private static ProviderContext createContext(Iterable<ExchangeRateProvider> providers)
getExchangeRateback to summary
public ExchangeRate getExchangeRate(ConversionQuery conversionQuery)

Implements abstract org.javamoney.moneta.spi.AbstractRateProvider.getExchangeRate.

Implements javax.money.convert.ExchangeRateProvider.getExchangeRate.

Doc from javax.money.convert.ExchangeRateProvider.getExchangeRate.

Access a ExchangeRate using the given currencies. The ExchangeRate may be, depending on the data provider, real-time or deferred. This method should return the rate that is currently valid.

Annotations
@Override
getExchangeRateback to summary
public ExchangeRate getExchangeRate(ConversionQuery conversionQuery, boolean failFast)