Class FxRateConfig

  • All Implemented Interfaces:
    Bean, ImmutableBean

    public final class FxRateConfig
    extends java.lang.Object
    implements 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 java.util.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​(java.util.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
      • toBuilder

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

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object