private CdsIsdaCreditCurveNode toCdsNode(CdsIndexIsdaCreditCurveNode index) { return CdsIsdaCreditCurveNode.builder() .label(index.getLabel()) .legalEntityId(index.getCdsIndexId()) .observableId(index.getObservableId()) .quoteConvention(index.getQuoteConvention()) .template(index.getTemplate()) .fixedRate(index.getFixedRate().isPresent() ? index.getFixedRate().getAsDouble() : null) .build(); }
/** * Returns a curve node with points upfront convention. * * @param template the template * @param observableId the observable ID * @param legalEntityId the legal entity ID * @param fixedRate the fixed rate * @return the curve node */ public static CdsIsdaCreditCurveNode ofPointsUpfront( CdsTemplate template, ObservableId observableId, StandardId legalEntityId, Double fixedRate) { return builder() .template(template) .observableId(observableId) .legalEntityId(legalEntityId) .quoteConvention(CdsQuoteConvention.POINTS_UPFRONT) .fixedRate(fixedRate) .build(); }
/** * Returns a curve node with quoted spread convention. * * @param template the template * @param observableId the observable ID * @param legalEntityId the legal entity ID * @param fixedRate the fixed rate * @return the curve node */ public static CdsIsdaCreditCurveNode ofQuotedSpread( CdsTemplate template, ObservableId observableId, StandardId legalEntityId, Double fixedRate) { return builder() .template(template) .observableId(observableId) .legalEntityId(legalEntityId) .quoteConvention(CdsQuoteConvention.QUOTED_SPREAD) .fixedRate(fixedRate) .build(); }