Class MarketDataConfig

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

    public final class MarketDataConfig
    extends Object
    implements org.joda.beans.ImmutableBean, Serializable
    Configuration required for building non-observable market data, for example curves or surfaces.

    This class is effectively a map of arbitrary objects, keyed by their type and a name.

    See Also:
    Serialized Form
    • Method Detail

      • empty

        public static MarketDataConfig empty()
        Returns an empty set of market data configuration.
        Returns:
        an empty set of market data configuration
      • builder

        public static MarketDataConfigBuilder builder()
        Returns a mutable builder for building an instance of MarketDataConfig.
        Returns:
        a mutable builder for building an instance of MarketDataConfig
      • get

        public <T> T get​(Class<T> type,
                         String name)
        Returns the configuration object with the specified type and name if available.
        Type Parameters:
        T - the type of the configuration object
        Parameters:
        type - the type of the configuration object
        name - the name of the configuration object
        Returns:
        the configuration with the specified type and name
        Throws:
        IllegalArgumentException - if no configuration is found with the specified type and name
      • get

        public <T> T get​(Class<T> type,
                         TypedString<?> name)
        Returns the configuration object with the specified type and name if available.
        Type Parameters:
        T - the type of the configuration object
        Parameters:
        type - the type of the configuration object
        name - the name of the configuration object
        Returns:
        the configuration with the specified type and name
        Throws:
        IllegalArgumentException - if no configuration is found with the specified type and name
      • get

        public <T> T get​(Class<T> type)
        Returns an item of configuration that is the default of its type.

        There can only be one default item for each type.

        There is a class of configuration where there is always a one value shared between all calculations. An example is the configuration which specifies which market quote to use when building FX rates for a currency pair. All calculations use the same set of FX rates obtained from the same underlying market data.

        Type Parameters:
        T - the type of the configuration object
        Parameters:
        type - the type of the configuration object
        Returns:
        the configuration with the specified type
        Throws:
        IllegalArgumentException - if no configuration is found with the specified type and name
      • find

        public <T> Optional<T> find​(Class<T> type)
        Returns an item of configuration that is the default of its type.

        There can only be one default item for each type.

        There is a class of configuration where there is always a one value shared between all calculations. An example is the configuration which specifies which market quote to use when building FX rates for a currency pair. All calculations use the same set of FX rates obtained from the same underlying market data.

        Type Parameters:
        T - the type of the configuration object
        Parameters:
        type - the type of the configuration object
        Returns:
        the configuration with the specified type, empty if not found
      • meta

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

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

        public int hashCode()
        Overrides:
        hashCode in class Object