Package com.opengamma.strata.data
Class FxRateId
- java.lang.Object
-
- com.opengamma.strata.data.FxRateId
-
- All Implemented Interfaces:
MarketDataId<FxRate>
,Serializable
,org.joda.beans.Bean
,org.joda.beans.ImmutableBean
public final class FxRateId extends Object implements MarketDataId<FxRate>, org.joda.beans.ImmutableBean, Serializable
Identifies the market data for an FX rate.The currency pair in a rate ID is always the market convention currency pair. If an ID is created using a non-conventional pair, the pair is inverted. This has no effect on the
FxRate
identified by the ID as it can handle both currency pairs that can be created from the two currencies.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
Class<FxRate>
getMarketDataType()
Gets the type of data this identifier refers to.ObservableSource
getObservableSource()
Gets the source of observable market data.CurrencyPair
getPair()
Gets the currency pair that is required.int
hashCode()
static org.joda.beans.TypedMetaBean<FxRateId>
meta()
The meta-bean forFxRateId
.org.joda.beans.TypedMetaBean<FxRateId>
metaBean()
static FxRateId
of(CurrencyPair currencyPair)
Obtains an instance representing the FX rate for a currency pair.static FxRateId
of(CurrencyPair currencyPair, ObservableSource observableSource)
Obtains an instance representing the FX rate for a currency pair, specifying the source.static FxRateId
of(Currency base, Currency counter)
Obtains an instance representing the FX rate for a currency pair.static FxRateId
of(Currency base, Currency counter, ObservableSource observableSource)
Obtains an instance representing the FX rate for a currency pair, specifying the source.String
toString()
-
-
-
Method Detail
-
of
public static FxRateId of(CurrencyPair currencyPair)
Obtains an instance representing the FX rate for a currency pair.- Parameters:
currencyPair
- a currency pair- Returns:
- an ID for the FX rate for the currency pair
-
of
public static FxRateId of(Currency base, Currency counter)
Obtains an instance representing the FX rate for a currency pair.- Parameters:
base
- the base currency of the paircounter
- the counter currency of the pair- Returns:
- an ID for the FX rate for the currency pair
-
of
public static FxRateId of(CurrencyPair currencyPair, ObservableSource observableSource)
Obtains an instance representing the FX rate for a currency pair, specifying the source.- Parameters:
currencyPair
- a currency pairobservableSource
- the source of the observable market data used to create the rate- Returns:
- an ID for the FX rate for the currency pair
-
of
public static FxRateId of(Currency base, Currency counter, ObservableSource observableSource)
Obtains an instance representing the FX rate for a currency pair, specifying the source.- Parameters:
base
- the base currency of the paircounter
- the counter currency of the pairobservableSource
- the source of the observable market data used to create the rate- Returns:
- an ID for the FX rate for the currency pair
-
getMarketDataType
public Class<FxRate> getMarketDataType()
Description copied from interface:MarketDataId
Gets the type of data this identifier refers to.- Specified by:
getMarketDataType
in interfaceMarketDataId<FxRate>
- Returns:
- the type of the market data this identifier refers to
-
meta
public static org.joda.beans.TypedMetaBean<FxRateId> meta()
The meta-bean forFxRateId
.- Returns:
- the meta-bean, not null
-
metaBean
public org.joda.beans.TypedMetaBean<FxRateId> metaBean()
- Specified by:
metaBean
in interfaceorg.joda.beans.Bean
-
getPair
public CurrencyPair getPair()
Gets the currency pair that is required. For example, 'GBP/USD'.- Returns:
- the value of the property, not null
-
getObservableSource
public ObservableSource getObservableSource()
Gets the source of observable market data. This is used when looking up the underlying market quotes for the rate.- Returns:
- the value of the property, not null
-
-