Class CurrencyParameterSensitivitiesBuilder

  • public final class CurrencyParameterSensitivitiesBuilder
    extends Object
    Builder for CurrencyParameterSensitivities.
    • Method Detail

      • add

        public CurrencyParameterSensitivitiesBuilder add​(MarketDataName<?> marketDataName,
                                                         Currency currency,
                                                         ParameterMetadata metadata,
                                                         double sensitivityValue)
        Adds a single sensitivity to the builder.

        Values with the same market data name and currency will be merged.

        marketDataName - the curve name
        currency - the currency of the sensitivity
        metadata - the sensitivity metadata, not empty
        sensitivityValue - the sensitivity value
        this, for chaining
      • mapMetadata

        public CurrencyParameterSensitivitiesBuilder mapMetadata​(UnaryOperator<ParameterMetadata> metadataFn)
        Maps the sensitivity metadata.

        If the function returns the same metadata for two different inputs, the sensitivity value will be summed. For example, this could be used to normalize tenors.

        metadataFn - the function to adjust the metadata
        this, for chaining
      • filterSensitivity

        public CurrencyParameterSensitivitiesBuilder filterSensitivity​(DoublePredicate predicate)
        Filters the sensitivity values.

        For example, this could be used to remove sensitivities near to zero.

        If the filter removes all the values for a market data name, the name will not be present in the result.

        predicate - the predicate to test the value, return true to retain the value
        this, for chaining
      • build

        public CurrencyParameterSensitivities build()
        Builds the sensitivity from the provided data.

        If all the values added are tenor-based, or all are date-based, then the resulting sensitivity will have the tenors sorted.

        the sensitivities instance