Class 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 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 pair
        counter - 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 pair
        observableSource - 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 pair
        counter - the counter currency of the pair
        observableSource - 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 interface MarketDataId<FxRate>
        Returns:
        the type of the market data this identifier refers to
      • meta

        public static org.joda.beans.TypedMetaBean<FxRateId> meta()
        The meta-bean for FxRateId.
        Returns:
        the meta-bean, not null
      • metaBean

        public org.joda.beans.TypedMetaBean<FxRateId> metaBean()
        Specified by:
        metaBean in interface org.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
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object