Class ImmutableScenarioMarketDataBuilder


  • public final class ImmutableScenarioMarketDataBuilder
    extends Object
    A mutable builder for market data.

    This is used to create implementations of ImmutableScenarioMarketData.

    • Method Detail

      • 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 identifier
        value - 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 identifier
        values - 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 identifier
        value - 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 identifier
        value - 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 identifier
        timeSeries - 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