Class ImmutableMarketDataBuilder

    • Method Detail

      • valuationDate

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

        public ImmutableMarketDataBuilder values​(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,
                                                             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
      • 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​(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
      • add

        public ImmutableMarketDataBuilder add​(MarketData other)
        Adds all time series and values from another market data instance.

        The valuation date of the other market data instance is ignored.

        Parameters:
        other - the other market data instance
        Returns:
        this builder
      • removeTimeSeriesIf

        public ImmutableMarketDataBuilder removeTimeSeriesIf​(Predicate<ObservableId> predicate)
        Removes values where the time series ID matches the specified predicate.
        Parameters:
        predicate - the predicate to apply, item removed if the predicate returns true
        Returns:
        this builder
      • removeValueIf

        public ImmutableMarketDataBuilder removeValueIf​(Predicate<MarketDataId<?>> predicate)
        Removes values where the value ID matches the specified predicate.
        Parameters:
        predicate - the predicate to apply, item removed if the predicate returns true
        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