Class ImmutableScenarioMarketDataBuilder
- java.lang.Object
-
- com.opengamma.strata.data.scenario.ImmutableScenarioMarketDataBuilder
-
public final class ImmutableScenarioMarketDataBuilder extends Object
A mutable builder for market data.This is used to create implementations of
ImmutableScenarioMarketData
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> ImmutableScenarioMarketDataBuilder
addBox(MarketDataId<T> id, MarketDataBox<? extends T> value)
Adds market data wrapped in a box.ImmutableScenarioMarketDataBuilder
addBoxMap(Map<? extends MarketDataId<?>,? extends MarketDataBox<?>> values)
Adds market data values for each scenario.<T> ImmutableScenarioMarketDataBuilder
addScenarioValue(MarketDataId<T> id, ScenarioArray<? extends T> value)
Adds market data for each scenario.<T> ImmutableScenarioMarketDataBuilder
addScenarioValue(MarketDataId<T> id, List<? extends T> values)
Adds market data for each scenario.ImmutableScenarioMarketDataBuilder
addScenarioValueMap(Map<? extends MarketDataId<?>,? extends ScenarioArray<?>> values)
Adds market data values for each scenario.ImmutableScenarioMarketDataBuilder
addTimeSeries(ObservableId id, LocalDateDoubleTimeSeries timeSeries)
Adds a time-series of observable market data values.ImmutableScenarioMarketDataBuilder
addTimeSeriesMap(Map<? extends ObservableId,LocalDateDoubleTimeSeries> timeSeriesMap)
Adds multiple time-series of observable market data values to the builder.<T> ImmutableScenarioMarketDataBuilder
addValue(MarketDataId<T> id, T value)
Adds market data that is valid for all scenarios.ImmutableScenarioMarketDataBuilder
addValueMap(Map<? extends MarketDataId<?>,?> values)
Adds market data values that are valid for all scenarios.ImmutableScenarioMarketData
build()
Builds the market data.ImmutableScenarioMarketDataBuilder
timeSeries(Map<? extends ObservableId,LocalDateDoubleTimeSeries> timeSeries)
Sets the time-series in the builder, replacing any existing values.ImmutableScenarioMarketDataBuilder
values(Map<? extends MarketDataId<?>,?> values)
Sets the values in the builder, replacing any existing values.
-
-
-
Method Detail
-
values
public ImmutableScenarioMarketDataBuilder values(Map<? extends MarketDataId<?>,?> values)
Sets the values in the builder, replacing any existing values.- Parameters:
values
- the values- Returns:
- this builder
-
timeSeries
public ImmutableScenarioMarketDataBuilder timeSeries(Map<? extends ObservableId,LocalDateDoubleTimeSeries> timeSeries)
Sets the time-series in the builder, replacing any existing values.- Parameters:
timeSeries
- the time-series- Returns:
- this builder
-
addValue
public <T> ImmutableScenarioMarketDataBuilder addValue(MarketDataId<T> id, T value)
Adds market data that is valid for all scenarios.Any existing value with the same identifier will be replaced.
- Type Parameters:
T
- the type of the market data value- Parameters:
id
- the identifiervalue
- the market data value- Returns:
- this builder
-
addValueMap
public ImmutableScenarioMarketDataBuilder addValueMap(Map<? extends MarketDataId<?>,?> values)
Adds market data values that are valid for all scenarios.Each value in the map is a single item of market data used in all scenarios. Any existing value with the same identifier will be replaced.
- Parameters:
values
- the items of market data, keyed by identifier- Returns:
- this builder
-
addScenarioValue
public <T> ImmutableScenarioMarketDataBuilder addScenarioValue(MarketDataId<T> id, List<? extends T> values)
Adds market data for each scenario.Any existing value with the same identifier will be replaced.
- Type Parameters:
T
- the type of the market data values- Parameters:
id
- the identifiervalues
- the market data values, one for each scenario- Returns:
- this builder
-
addScenarioValue
public <T> ImmutableScenarioMarketDataBuilder addScenarioValue(MarketDataId<T> id, ScenarioArray<? extends T> value)
Adds market data for each scenario.Any existing value with the same identifier will be replaced.
- Type Parameters:
T
- the type of the market data values- Parameters:
id
- the identifiervalue
- the market data values, one for each scenario- Returns:
- this builder
-
addScenarioValueMap
public ImmutableScenarioMarketDataBuilder addScenarioValueMap(Map<? extends MarketDataId<?>,? extends ScenarioArray<?>> values)
Adds market data values for each scenario.Each value in the map contains multiple market data items, one for each scenario. Any existing value with the same identifier will be replaced.
- Parameters:
values
- the items of market data, keyed by identifier- Returns:
- this builder
-
addBox
public <T> ImmutableScenarioMarketDataBuilder addBox(MarketDataId<T> id, MarketDataBox<? extends T> value)
Adds market data wrapped in a box.Any existing value with the same identifier will be replaced.
- Type Parameters:
T
- the type of the market data value- Parameters:
id
- the identifiervalue
- the market data value- Returns:
- this builder
-
addBoxMap
public ImmutableScenarioMarketDataBuilder addBoxMap(Map<? extends MarketDataId<?>,? extends MarketDataBox<?>> values)
Adds market data values for each scenario.Each value in the map is a market data box. Any existing value with the same identifier will be replaced.
- Parameters:
values
- the items of market data, keyed by identifier- Returns:
- this builder
-
addTimeSeries
public ImmutableScenarioMarketDataBuilder addTimeSeries(ObservableId id, LocalDateDoubleTimeSeries timeSeries)
Adds a time-series of observable market data values.Any existing time-series with the same identifier will be replaced.
- Parameters:
id
- the identifiertimeSeries
- a time-series of observable market data values- Returns:
- this builder
-
addTimeSeriesMap
public ImmutableScenarioMarketDataBuilder addTimeSeriesMap(Map<? extends ObservableId,LocalDateDoubleTimeSeries> timeSeriesMap)
Adds multiple time-series of observable market data values to the builder.Any existing time-series with the same identifier will be replaced.
- Parameters:
timeSeriesMap
- the map of time-series- Returns:
- this builder
-
build
public ImmutableScenarioMarketData build()
Builds the market data.- Returns:
- the market data
-
-