Interface FxRateLookup
-
- All Superinterfaces:
CalculationParameter
- All Known Subinterfaces:
RatesMarketDataLookup
public interface FxRateLookup extends CalculationParameter
The lookup that provides access to FX rates in market data.An instance of
MarketData
can contain many different FX rates. This lookup allows a specific set of rates to be obtained.Implementations of this interface must be immutable.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description FxRateProvider
fxRateProvider(MarketData marketData)
Obtains an FX rate provider based on the specified market data.static FxRateLookup
ofMatrix()
Obtains an instance that uses an FX matrix.static FxRateLookup
ofMatrix(FxMatrixId matrixId)
Obtains an instance that uses an FX matrix.static FxRateLookup
ofRates()
Obtains the standard instance.static FxRateLookup
ofRates(Currency triangulationCurrency)
Obtains an instance that uses triangulation on the specified currency.static FxRateLookup
ofRates(Currency triangulationCurrency, ObservableSource observableSource)
Obtains an instance that uses triangulation on the specified currency.static FxRateLookup
ofRates(ObservableSource observableSource)
Obtains the standard instance.default Class<? extends CalculationParameter>
queryType()
Gets the type that the parameter will be queried by.-
Methods inherited from interface com.opengamma.strata.calc.runner.CalculationParameter
filter
-
-
-
-
Method Detail
-
ofRates
static FxRateLookup ofRates()
Obtains the standard instance.This expects the market data to contain instances of
FxRateId
based on the defaultObservableSource
. Triangulation will use the default of the currency, typically USD.- Returns:
- the FX rate lookup
-
ofRates
static FxRateLookup ofRates(ObservableSource observableSource)
Obtains the standard instance.This expects the market data to contain instances of
FxRateId
based on the specifiedObservableSource
. Triangulation will use the default of the currency, typically USD.- Parameters:
observableSource
- the source of observable market data- Returns:
- the FX rate lookup
-
ofRates
static FxRateLookup ofRates(Currency triangulationCurrency)
Obtains an instance that uses triangulation on the specified currency.This expects the market data to contain instances of
FxRateId
based on the defaultObservableSource
. Triangulation will use the specified currency.- Parameters:
triangulationCurrency
- the triangulation currency- Returns:
- the FX rate lookup
-
ofRates
static FxRateLookup ofRates(Currency triangulationCurrency, ObservableSource observableSource)
Obtains an instance that uses triangulation on the specified currency.This expects the market data to contain instances of
FxRateId
based on the specifiedObservableSource
. Triangulation will use the specified currency.- Parameters:
triangulationCurrency
- the triangulation currencyobservableSource
- the source of observable market data- Returns:
- the FX rate lookup
-
ofMatrix
static FxRateLookup ofMatrix()
Obtains an instance that uses an FX matrix.This expects the market data to contain an instance of
FxMatrix
accessed by the standardFxMatrixId
.- Returns:
- the FX rate lookup
-
ofMatrix
static FxRateLookup ofMatrix(FxMatrixId matrixId)
Obtains an instance that uses an FX matrix.This expects the market data to contain an instance of
FxMatrix
accessed by the specifiedFxMatrixId
.- Parameters:
matrixId
- the FX matrix identifier- Returns:
- the FX rate lookup
-
queryType
default Class<? extends CalculationParameter> queryType()
Description copied from interface:CalculationParameter
Gets the type that the parameter will be queried by.Parameters can be queried using
CalculationParameters.findParameter(Class)
. This type is the key that callers must use in that method.By default, this is just
Object.getClass()
. It will only differ if the query type is an interface rather than the concrete class.- Specified by:
queryType
in interfaceCalculationParameter
- Returns:
- the type of the parameter implementation
-
fxRateProvider
FxRateProvider fxRateProvider(MarketData marketData)
Obtains an FX rate provider based on the specified market data.This provides an
FxRateProvider
suitable for obtaining FX rates.- Parameters:
marketData
- the complete set of market data for one scenario- Returns:
- the FX rate provider
-
-