Class MarketDataConfig
- java.lang.Object
-
- com.opengamma.strata.calc.marketdata.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MarketDataConfig.Meta
The meta-bean forMarketDataConfig
.
-
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 ofMarketDataConfig
.static MarketDataConfig
empty()
Returns an empty set of market data configuration.boolean
equals(Object obj)
<T> Optional<T>
find(Class<T> type)
Returns an item of configuration that is the default of its type.<T> T
get(Class<T> type)
Returns an item of configuration that is the default of its type.<T> T
get(Class<T> type, TypedString<?> name)
Returns the configuration object with the specified type and name if available.<T> T
get(Class<T> type, String name)
Returns the configuration object with the specified type and name if available.int
hashCode()
static MarketDataConfig.Meta
meta()
The meta-bean forMarketDataConfig
.MarketDataConfig.Meta
metaBean()
String
toString()
-
-
-
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 ofMarketDataConfig
.- 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 objectname
- 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 objectname
- 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 forMarketDataConfig
.- Returns:
- the meta-bean, not null
-
metaBean
public MarketDataConfig.Meta metaBean()
- Specified by:
metaBean
in interfaceorg.joda.beans.Bean
-
-