Class FxRateConfig

  • All Implemented Interfaces:
    org.joda.beans.Bean, org.joda.beans.ImmutableBean

    public final class FxRateConfig
    extends Object
    implements org.joda.beans.ImmutableBean
    Configuration defining how to create FxRate instances from observable market data.

    Currently this only supports rates which are observable in the market. Cross rates derived from other rates will be supported later.

    This class is likely to change when support for cross rates is added.

    When populating this class all currency pairs must be quoted using the market conventions.

    • Method Detail

      • getObservableRateKey

        public Optional<QuoteId> getObservableRateKey​(CurrencyPair currencyPair)
        Returns a key identifying the market quote for an observable FX rate.

        If the FX rate is not observable in the market an empty optional is returned.

        It is possible the quote is for the rate of the inverse of the currency pair. This does not matter as the market data system ensures that the correct rate is always provided regardless of which way round the pair is quoted.

        Parameters:
        currencyPair - the currency pair
        Returns:
        a key identifying the market quote for the rate if it is observable in the market
      • of

        public static FxRateConfig of​(Map<CurrencyPair,​QuoteId> quotesMap)
        Returns FX rate configuration built using the data in the map.
        Parameters:
        quotesMap - map of currency pairs to the market quotes defining their rates
        Returns:
        FX rate configuration built using the data in the map
      • meta

        public static FxRateConfig.Meta meta()
        The meta-bean for FxRateConfig.
        Returns:
        the meta-bean, not null
      • builder

        public static FxRateConfig.Builder builder()
        Returns a builder used to create an instance of the bean.
        Returns:
        the builder, not null
      • metaBean

        public FxRateConfig.Meta metaBean()
        Specified by:
        metaBean in interface org.joda.beans.Bean
      • toBuilder

        public FxRateConfig.Builder toBuilder()
        Returns a builder that allows this bean to be mutated.
        Returns:
        the mutable builder, not null
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object