@Override
public Set<ValueRequirement> getRequirements(final FunctionCompilationContext context,
final ComputationTarget target,
final ValueRequirement desiredValue) {
final CreditDefaultSwapSecurity cds = (CreditDefaultSwapSecurity) target.getSecurity();
final CreditCurveIdentifier spreadIdentifier = getSpreadCurveIdentifier(cds);
final Currency ccy = cds.getNotional().getCurrency();
final CreditCurveIdentifier isdaIdentifier = getISDACurveIdentifier(cds);
final String isdaOffset = desiredValue.getConstraint(ISDAFunctionConstants.ISDA_CURVE_OFFSET);
if (isdaOffset == null) {
return null;
}
final String isdaCurveDate = desiredValue.getConstraint(ISDAFunctionConstants.ISDA_CURVE_DATE);
if (isdaCurveDate == null) {
return null;
}
final String isdaCurveMethod = desiredValue.getConstraint(ISDAFunctionConstants.ISDA_IMPLEMENTATION);
if (isdaCurveMethod == null) {
return null;
}
if (desiredValue.getConstraint(ISDAFunctionConstants.CDS_QUOTE_CONVENTION) == null) {
return null;
}
// isda curve
final ValueProperties isdaProperties = ValueProperties.builder()
.with(ValuePropertyNames.CURVE, isdaIdentifier.toString())
.with(ValuePropertyNames.CURVE_CALCULATION_METHOD, ISDAFunctionConstants.ISDA_METHOD_NAME)
.with(ISDAFunctionConstants.ISDA_CURVE_OFFSET, isdaOffset)
.with(ISDAFunctionConstants.ISDA_CURVE_DATE, isdaCurveDate)
.with(ISDAFunctionConstants.ISDA_IMPLEMENTATION, isdaCurveMethod)
.get();