Interface CalculationParameter
-
- All Known Subinterfaces:
BondFutureOptionMarketDataLookup
,CreditRatesMarketDataLookup
,FxOptionMarketDataLookup
,FxRateLookup
,IborCapFloorMarketDataLookup
,IborFutureOptionMarketDataLookup
,LegalEntityDiscountingMarketDataLookup
,RatesMarketDataLookup
,SwaptionMarketDataLookup
- All Known Implementing Classes:
CmsSabrExtrapolationParams
,FxSingleBarrierOptionMethod
,FxVanillaOptionMethod
,TargetTypeCalculationParameter
,TradeCounterpartyCalculationParameter
public interface CalculationParameter
The base interface for calculation parameters.Parameters are used to control the calculation.
For example,
ReportingCurrency
is a parameter that controls currency conversion. If specified, on aColumn
, or inCalculationRules
, then the output will be converted to the specified currency.Applications may implement this interface to add new parameters to the system. In order to be used, new implementations of
CalculationFunction
must be written that receive the parameters and perform appropriate behavior.Implementations of this interface must be immutable.
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default Optional<CalculationParameter>
filter(CalculationTarget target, Measure measure)
Filters this parameter to the specified target and measure.default Class<? extends CalculationParameter>
queryType()
Gets the type that the parameter will be queried by.
-
-
-
Method Detail
-
queryType
default Class<? extends CalculationParameter> queryType()
Gets the type that the parameter will be queried by.Parameters can be queried using
CalculationParameters.findParameter(Class)
. This type is the key that callers must use in that method.By default, this is just
Object.getClass()
. It will only differ if the query type is an interface rather than the concrete class.- Returns:
- the type of the parameter implementation
-
filter
default Optional<CalculationParameter> filter(CalculationTarget target, Measure measure)
Filters this parameter to the specified target and measure.Parameters may apply to all targets and measures or just a subset. The
CalculationParameters.filter(CalculationTarget, Measure)
method uses this method to filter a complete set of parameters.By default, this returns
Optional.of(this)
. If the parameter does not apply to either the target or measure, then optional empty must be returned. If desired, the result can be a different parameter, allowing one parameter to delegate to another when filtered.- Parameters:
target
- the calculation target, such as a trademeasure
- the measure to be calculated- Returns:
- the parameter appropriate to the target and measure, empty if this parameter does not apply
-
-