/// <summary> /// Adds a single sensitivity to the builder. /// <para> /// Values with the same market data name and currency will be merged. /// /// </para> /// </summary> /// <param name="type"> the sensitivity type </param> /// <param name="curveName"> the curve name </param> /// <param name="currency"> the currency of the sensitivity </param> /// <param name="metadata"> the sensitivity metadata, not empty </param> /// <param name="sensitivityValue"> the sensitivity value </param> /// <returns> this, for chaining </returns> public CurveSensitivitiesBuilder add(CurveSensitivitiesType type, CurveName curveName, Currency currency, ParameterMetadata metadata, double sensitivityValue) { data.computeIfAbsent(type, t => CurrencyParameterSensitivities.builder()).add(curveName, currency, metadata, sensitivityValue); return(this); }
//------------------------------------------------------------------------- /// <summary> /// Adds a sensitivity to the builder. /// <para> /// Values with the same market data name and currency will be merged. /// /// </para> /// </summary> /// <param name="type"> the sensitivity type </param> /// <param name="sensitivity"> the sensitivity to ad </param> /// <returns> this, for chaining </returns> public CurveSensitivitiesBuilder add(CurveSensitivitiesType type, CurrencyParameterSensitivity sensitivity) { data.computeIfAbsent(type, t => CurrencyParameterSensitivities.builder()).add(sensitivity); return(this); }