public void test_builder() { CdsIndexIsdaCreditCurveNode test = CdsIndexIsdaCreditCurveNode.builder() .label(LABEL) .template(TEMPLATE) .observableId(QUOTE_ID) .quoteConvention(CdsQuoteConvention.PAR_SPREAD) .cdsIndexId(INDEX_ID) .legalEntityIds(LEGAL_ENTITIES) .build(); assertEquals(test.getLabel(), LABEL); assertEquals(test.getCdsIndexId(), INDEX_ID); assertEquals(test.getLegalEntityIds(), LEGAL_ENTITIES); assertEquals(test.getObservableId(), QUOTE_ID); assertEquals(test.getTemplate(), TEMPLATE); assertEquals(test.date(VAL_DATE, REF_DATA), date(2025, 6, 20)); }
/** * Returns a curve node with par spread convention. * * @param template the template * @param observableId the observable ID * @param cdsIndexId the CDS index ID * @param legalEntityIds the legal entity IDs * @return the curve node */ public static CdsIndexIsdaCreditCurveNode ofParSpread( CdsTemplate template, ObservableId observableId, StandardId cdsIndexId, List<StandardId> legalEntityIds) { return builder() .template(template) .observableId(observableId) .cdsIndexId(cdsIndexId) .legalEntityIds(legalEntityIds) .quoteConvention(CdsQuoteConvention.PAR_SPREAD) .build(); }
/** * Returns a curve node with quoted spread convention. * * @param template the template * @param observableId the observable ID * @param cdsIndexId the CDS index ID * @param legalEntityIds the legal entity IDs * @param fixedRate the fixed rate * @return the curve node */ public static CdsIndexIsdaCreditCurveNode ofQuotedSpread( CdsTemplate template, ObservableId observableId, StandardId cdsIndexId, List<StandardId> legalEntityIds, Double fixedRate) { return builder() .template(template) .observableId(observableId) .cdsIndexId(cdsIndexId) .legalEntityIds(legalEntityIds) .quoteConvention(CdsQuoteConvention.QUOTED_SPREAD) .fixedRate(fixedRate) .build(); }
/** * Returns a curve node with points upfront convention. * * @param template the template * @param observableId the observable ID * @param cdsIndexId the CDS index ID * @param legalEntityIds the legal entity IDs * @param fixedRate the fixed rate * @return the curve node */ public static CdsIndexIsdaCreditCurveNode ofPointsUpfront( CdsTemplate template, ObservableId observableId, StandardId cdsIndexId, List<StandardId> legalEntityIds, Double fixedRate) { return builder() .template(template) .observableId(observableId) .cdsIndexId(cdsIndexId) .legalEntityIds(legalEntityIds) .quoteConvention(CdsQuoteConvention.POINTS_UPFRONT) .fixedRate(fixedRate) .build(); }
@Override public CdsIndexIsdaCreditCurveNode.Builder builder() { return new CdsIndexIsdaCreditCurveNode.Builder(); }
/** * Sets the {@code legalEntityIds} property in the builder * from an array of objects. * @param legalEntityIds the new value, not null * @return this, for chaining, not null */ public Builder legalEntityIds(StandardId... legalEntityIds) { return legalEntityIds(ImmutableList.copyOf(legalEntityIds)); }
/** * Returns a builder that allows this bean to be mutated. * @return the mutable builder, not null */ public Builder toBuilder() { return new Builder(this); }
public void test_build_fail_noRate() { assertThrows( () -> CdsIndexIsdaCreditCurveNode.builder().template(TEMPLATE).observableId(QUOTE_ID).cdsIndexId(INDEX_ID) .legalEntityIds(LEGAL_ENTITIES).quoteConvention(CdsQuoteConvention.QUOTED_SPREAD).build(), IllegalArgumentException.class); }
/** * Returns a builder used to create an instance of the bean. * @return the builder, not null */ public static CdsIndexIsdaCreditCurveNode.Builder builder() { return new CdsIndexIsdaCreditCurveNode.Builder(); }