Class CurrencyParameterSensitivitiesBuilder
- java.lang.Object
-
- com.opengamma.strata.market.param.CurrencyParameterSensitivitiesBuilder
-
public final class CurrencyParameterSensitivitiesBuilder extends Object
Builder forCurrencyParameterSensitivities
.
-
-
Method Summary
-
-
-
Method Detail
-
add
public CurrencyParameterSensitivitiesBuilder add(CurrencyParameterSensitivities sensitivities)
Adds sensitivities to the builder.Values with the same market data name and currency will be merged.
- Parameters:
sensitivities
- the sensitivities to add- Returns:
- this, for chaining
-
add
public CurrencyParameterSensitivitiesBuilder add(List<CurrencyParameterSensitivity> sensitivities)
Adds sensitivities to the builder.Values with the same market data name and currency will be merged.
- Parameters:
sensitivities
- the sensitivities to add- Returns:
- this, for chaining
-
add
public CurrencyParameterSensitivitiesBuilder add(CurrencyParameterSensitivity sensToAdd)
Adds a sensitivity to the builder.Values with the same market data name and currency will be merged.
- Parameters:
sensToAdd
- the sensitivity to add- Returns:
- this, for chaining
-
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 namecurrency
- the currency of the sensitivitymetadata
- the sensitivity metadata, not emptysensitivityValue
- the sensitivity value- Returns:
- 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.
- Parameters:
metadataFn
- the function to adjust the metadata- Returns:
- this, for chaining
-
mapSensitivities
public CurrencyParameterSensitivitiesBuilder mapSensitivities(BiFunction<ParameterMetadata,Double,Double> mapFn)
Maps the sensitivity.- Parameters:
mapFn
- the function to adjust the sensitivity- Returns:
- 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.
- 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
-
-