Class CurrencyParameterSensitivitiesBuilder


  • public final class CurrencyParameterSensitivitiesBuilder
    extends java.lang.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.

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

        public CurrencyParameterSensitivitiesBuilder mapMetadata​(java.util.function.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.

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

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

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

        Parameters:
        predicate - the predicate to test the value, return true to retain the value
        Returns:
        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.

        Returns:
        the sensitivities instance