Class MarketDataConfigBuilder
- java.lang.Object
-
- com.opengamma.strata.calc.marketdata.MarketDataConfigBuilder
-
public final class MarketDataConfigBuilder extends Object
A mutable builder for building an instance ofMarketDataConfig
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MarketDataConfigBuilder
add(TypedString<?> name, Object value)
Adds an item of configuration under the specified name.MarketDataConfigBuilder
add(String name, Object value)
Adds an item of configuration under the specified name.<T> MarketDataConfigBuilder
addDefault(T value)
Adds an item of configuration that is the default of its type.MarketDataConfig
build()
Returns aMarketDataConfig
instance built from the data in this builder.
-
-
-
Method Detail
-
add
public MarketDataConfigBuilder add(String name, Object value)
Adds an item of configuration under the specified name.- Parameters:
name
- the name of the configuration itemvalue
- the configuration item- Returns:
- this builder
-
add
public MarketDataConfigBuilder add(TypedString<?> name, Object value)
Adds an item of configuration under the specified name.- Parameters:
name
- the name of the configuration itemvalue
- the configuration item- Returns:
- this builder
-
addDefault
public <T> MarketDataConfigBuilder addDefault(T value)
Adds 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 used when looking up the configuration- Parameters:
value
- the configuration value- Returns:
- this builder
-
build
public MarketDataConfig build()
Returns aMarketDataConfig
instance built from the data in this builder.- Returns:
- a
MarketDataConfig
instance built from the data in this builder
-
-