Class MarketDataConfig

  • All Implemented Interfaces:
    java.io.Serializable, Bean, ImmutableBean

    public final class MarketDataConfig
    extends java.lang.Object
    implements ImmutableBean, java.io.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
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  MarketDataConfig.Meta
      The meta-bean for MarketDataConfig.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static MarketDataConfigBuilder builder()
      Returns a mutable builder for building an instance of MarketDataConfig.
      static MarketDataConfig empty()
      Returns an empty set of market data configuration.
      boolean equals​(java.lang.Object obj)  
      <T> java.util.Optional<T> find​(java.lang.Class<T> type)
      Returns an item of configuration that is the default of its type.
      <T> T get​(java.lang.Class<T> type)
      Returns an item of configuration that is the default of its type.
      <T> T get​(java.lang.Class<T> type, TypedString<?> name)
      Returns the configuration object with the specified type and name if available.
      <T> T get​(java.lang.Class<T> type, java.lang.String name)
      Returns the configuration object with the specified type and name if available.
      int hashCode()  
      static MarketDataConfig.Meta meta()
      The meta-bean for MarketDataConfig.
      MarketDataConfig.Meta metaBean()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • 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​(java.lang.Class<T> type,
                         java.lang.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:
        java.lang.IllegalArgumentException - if no configuration is found with the specified type and name
      • get

        public <T> T get​(java.lang.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:
        java.lang.IllegalArgumentException - if no configuration is found with the specified type and name
      • get

        public <T> T get​(java.lang.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:
        java.lang.IllegalArgumentException - if no configuration is found with the specified type and name
      • find

        public <T> java.util.Optional<T> find​(java.lang.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
      • 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