Class ImmutableMarketDataBuilder


  • public class ImmutableMarketDataBuilder
    extends java.lang.Object
    A mutable builder for instances of ImmutableMarketData.
    • Method Detail

      • valuationDate

        public ImmutableMarketDataBuilder valuationDate​(java.time.LocalDate valuationDate)
        Sets the valuation date.
        Parameters:
        valuationDate - the valuation date to set
        Returns:
        this builder
      • values

        public ImmutableMarketDataBuilder values​(java.util.Map<? extends MarketDataId<?>,​?> values)
        Sets the values in the builder, replacing any existing values.
        Parameters:
        values - the values
        Returns:
        this builder
      • addValue

        public <T> ImmutableMarketDataBuilder addValue​(MarketDataId<T> id,
                                                       T value)
        Adds a value to the builder.
        Type Parameters:
        T - the type of the market data value
        Parameters:
        id - the identifier
        value - the market data value
        Returns:
        this builder
      • addValueUnsafe

        public <T> ImmutableMarketDataBuilder addValueUnsafe​(MarketDataId<?> id,
                                                             java.lang.Object value)
        Adds a value to the builder when the types are not known at compile time.
        Type Parameters:
        T - the type of the market data value
        Parameters:
        id - the identifier
        value - the market data value
        Returns:
        this builder
      • addValueMap

        public ImmutableMarketDataBuilder addValueMap​(java.util.Map<? extends MarketDataId<?>,​?> values)
        Adds multiple values to the builder.
        Parameters:
        values - the values
        Returns:
        this builder
      • addTimeSeries

        public ImmutableMarketDataBuilder 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 ImmutableMarketDataBuilder addTimeSeriesMap​(java.util.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 ImmutableMarketData build()
        Returns a set of market data built from the data in this builder.
        Returns:
        a set of market data built from the data in this builder