.orElse(BusinessDayAdjustment.NONE); PeriodicSchedule.Builder scheduleBuilder = PeriodicSchedule.builder() .startDate(effectiveDate.getUnadjusted()) .startDateBusinessDayAdjustment(effectiveDate.getAdjustment()) .endDate(terminationDate.getUnadjusted()) .endDateBusinessDayAdjustment(terminationDate.getAdjustment()) .businessDayAdjustment(bda); scheduleBuilder.frequency(periodicPaymentEl.findChild("paymentFrequency") .map(el -> document.parseFrequency(el)) .orElse(Frequency.P3M)); periodicPaymentEl.findChild("firstPaymentDate") .ifPresent(el -> scheduleBuilder.firstRegularStartDate(document.parseDate(el))); periodicPaymentEl.findChild("firstPeriodStartDate") .ifPresent(el -> scheduleBuilder.overrideStartDate(AdjustableDate.of(document.parseDate(el)))); periodicPaymentEl.findChild("lastRegularPaymentDate") .ifPresent(el -> scheduleBuilder.lastRegularEndDate(document.parseDate(el))); scheduleBuilder.rollConvention( periodicPaymentEl.findChild("rollConvention") .map(el -> document.convertRollConvention(el.getContent())) .currency(notional.getCurrency()) .notional(notional.getAmount()) .paymentSchedule(scheduleBuilder.build()) .fixedRate(fixedRate) .dayCount(dayCount) .currency(notional.getCurrency()) .notional(notional.getAmount())
.paymentSchedule( PeriodicSchedule.builder() .startDate(startDate) .endDate(endDate) .frequency(P3M) .businessDayAdjustment(BUSI_ADJ_STD) .startDateBusinessDayAdjustment(BUSI_ADJ_STD) .endDateBusinessDayAdjustment(BusinessDayAdjustment.NONE) .stubConvention(StubConvention.SMART_INITIAL) .rollConvention(RollConventions.DAY_20) .build()) .buySell(BUY) .currency(GBP)
.paymentSchedule( PeriodicSchedule.builder() .startDate(startDate) .endDate(endDate) .frequency(paymentFrequency) .businessDayAdjustment(businessDayAdjustment) .startDateBusinessDayAdjustment(getStartDateBusinessDayAdjustment()) .endDateBusinessDayAdjustment(getEndDateBusinessDayAdjustment()) .stubConvention(stubConvention) .rollConvention(rollConvention) .build()) .buySell(buySell) .currency(currency) .paymentSchedule( PeriodicSchedule.builder() .startDate(startDate) .endDate(endDate) .frequency(paymentFrequency) .businessDayAdjustment(businessDayAdjustment) .startDateBusinessDayAdjustment(getStartDateBusinessDayAdjustment()) .endDateBusinessDayAdjustment(getEndDateBusinessDayAdjustment()) .stubConvention(stubConvention) .rollConvention(rollConvention) .build()) .buySell(buySell) .currency(currency)
.payReceive(PAY) .accrualSchedule(PeriodicSchedule.builder() .startDate(date(1995, 1, 16)) .endDate(date(1999, 12, 14)) .firstRegularStartDate(date(1995, 6, 14)) .startDateBusinessDayAdjustment(BusinessDayAdjustment.NONE) .businessDayAdjustment(BusinessDayAdjustment.of(MODIFIED_FOLLOWING, SAT_SUN)) .frequency(Frequency.P6M) .rollConvention(RollConvention.ofDayOfMonth(14)) .build()) .paymentSchedule(PaymentSchedule.builder() .paymentFrequency(Frequency.P6M) .payReceive(RECEIVE) .accrualSchedule(PeriodicSchedule.builder() .startDate(date(1995, 1, 16)) .endDate(date(1999, 12, 14)) .firstRegularStartDate(date(1995, 12, 14)) .startDateBusinessDayAdjustment(BusinessDayAdjustment.NONE) .businessDayAdjustment(BusinessDayAdjustment.of(MODIFIED_FOLLOWING, SAT_SUN)) .frequency(Frequency.P12M) .rollConvention(RollConvention.ofDayOfMonth(14)) .build()) .paymentSchedule(PaymentSchedule.builder() .paymentFrequency(Frequency.P12M)
.payReceive(PAY) .accrualSchedule(PeriodicSchedule.builder() .startDate(date(1995, 1, 16)) .endDate(date(1999, 12, 14)) .firstRegularStartDate(date(1995, 6, 14)) .startDateBusinessDayAdjustment(BusinessDayAdjustment.NONE) .businessDayAdjustment(BusinessDayAdjustment.of(MODIFIED_FOLLOWING, EUTA)) .frequency(Frequency.P6M) .rollConvention(RollConvention.ofDayOfMonth(14)) .build()) .paymentSchedule(PaymentSchedule.builder() .paymentFrequency(Frequency.P6M) .payReceive(RECEIVE) .accrualSchedule(PeriodicSchedule.builder() .startDate(date(1995, 1, 16)) .endDate(date(1999, 12, 14)) .firstRegularStartDate(date(1995, 12, 14)) .startDateBusinessDayAdjustment(BusinessDayAdjustment.NONE) .businessDayAdjustment(BusinessDayAdjustment.of(MODIFIED_FOLLOWING, EUTA)) .frequency(Frequency.P12M) .rollConvention(RollConvention.ofDayOfMonth(14)) .build()) .paymentSchedule(PaymentSchedule.builder() .paymentFrequency(Frequency.P12M)
.payReceive(PayReceive.PAY) .accrualSchedule(PeriodicSchedule.builder() .startDate(date(1994, 12, 14)) .endDate(date(1999, 12, 14)) .startDateBusinessDayAdjustment(BusinessDayAdjustment.NONE) .businessDayAdjustment(BusinessDayAdjustment.of(MODIFIED_FOLLOWING, FRPA)) .frequency(Frequency.P6M) .rollConvention(RollConvention.ofDayOfMonth(14)) .build()) .paymentSchedule(PaymentSchedule.builder() .paymentFrequency(Frequency.P6M) .payReceive(PayReceive.RECEIVE) .accrualSchedule(PeriodicSchedule.builder() .startDate(date(1994, 12, 14)) .endDate(date(1999, 12, 14)) .startDateBusinessDayAdjustment(BusinessDayAdjustment.NONE) .businessDayAdjustment(BusinessDayAdjustment.of(MODIFIED_FOLLOWING, FRPA)) .frequency(Frequency.P12M) .rollConvention(RollConvention.ofDayOfMonth(14)) .build()) .paymentSchedule(PaymentSchedule.builder() .paymentFrequency(Frequency.P12M)
.payReceive(RECEIVE) .accrualSchedule(PeriodicSchedule.builder() .startDate(date(2000, 4, 27)) .endDate(date(2002, 4, 27)) .startDateBusinessDayAdjustment(BusinessDayAdjustment.NONE) .businessDayAdjustment(BusinessDayAdjustment.of(MODIFIED_FOLLOWING, SAT_SUN)) .frequency(Frequency.P3M) .rollConvention(RollConvention.ofDayOfMonth(27)) .build()) .paymentSchedule(PaymentSchedule.builder() .paymentFrequency(Frequency.P6M) .payReceive(PAY) .accrualSchedule(PeriodicSchedule.builder() .startDate(date(2000, 4, 27)) .endDate(date(2002, 4, 27)) .startDateBusinessDayAdjustment(BusinessDayAdjustment.NONE) .businessDayAdjustment(BusinessDayAdjustment.of(MODIFIED_FOLLOWING, SAT_SUN)) .frequency(Frequency.P6M) .rollConvention(RollConvention.ofDayOfMonth(27)) .build()) .paymentSchedule(PaymentSchedule.builder() .paymentFrequency(Frequency.P6M)
.payReceive(PAY) .accrualSchedule(PeriodicSchedule.builder() .startDate(DATE_02_03) .endDate(DATE_04_03) .firstRegularStartDate(DATE_02_05) .lastRegularEndDate(DATE_03_05) .frequency(P1M) .stubConvention(StubConvention.BOTH) .businessDayAdjustment(BusinessDayAdjustment.of(FOLLOWING, GBLO)) .build()) .paymentSchedule(PaymentSchedule.builder() .paymentFrequency(P1M)
.payReceive(PAY) .accrualSchedule(PeriodicSchedule.builder() .startDate(date(1995, 1, 16)) .endDate(date(1999, 12, 14)) .firstRegularStartDate(date(1995, 6, 14)) .startDateBusinessDayAdjustment(BusinessDayAdjustment.NONE) .businessDayAdjustment(BusinessDayAdjustment.of(MODIFIED_FOLLOWING, EUTA)) .frequency(Frequency.P6M) .rollConvention(RollConvention.ofDayOfMonth(14)) .build()) .paymentSchedule(PaymentSchedule.builder() .paymentFrequency(Frequency.P6M) .payReceive(RECEIVE) .accrualSchedule(PeriodicSchedule.builder() .startDate(date(1995, 1, 16)) .endDate(date(1999, 12, 14)) .firstRegularStartDate(date(1995, 12, 14)) .startDateBusinessDayAdjustment(BusinessDayAdjustment.NONE) .businessDayAdjustment(BusinessDayAdjustment.of(MODIFIED_FOLLOWING, EUTA)) .frequency(Frequency.P12M) .rollConvention(RollConvention.ofDayOfMonth(14)) .build()) .paymentSchedule(PaymentSchedule.builder() .paymentFrequency(Frequency.P12M)
.payReceive(PAY) .accrualSchedule(PeriodicSchedule.builder() .startDate(date(2000, 4, 5)) .firstRegularStartDate(date(2000, 10, 5)) .lastRegularEndDate(date(2004, 10, 5)) .endDate(date(2005, 1, 5)) .overrideStartDate(AdjustableDate.of(date(2000, 3, 5), BusinessDayAdjustment.NONE)) .startDateBusinessDayAdjustment(BusinessDayAdjustment.NONE) .businessDayAdjustment(BusinessDayAdjustment.of(FOLLOWING, EUTA)) .frequency(Frequency.P6M) .rollConvention(RollConvention.ofDayOfMonth(5)) .build()) .paymentSchedule(PaymentSchedule.builder() .paymentFrequency(Frequency.P6M) .payReceive(RECEIVE) .accrualSchedule(PeriodicSchedule.builder() .startDate(date(2000, 4, 5)) .firstRegularStartDate(date(2000, 10, 5)) .lastRegularEndDate(date(2004, 10, 5)) .endDate(date(2005, 1, 5)) .overrideStartDate(AdjustableDate.of(date(2000, 3, 5), BusinessDayAdjustment.NONE)) .startDateBusinessDayAdjustment(BusinessDayAdjustment.NONE) .businessDayAdjustment(BusinessDayAdjustment.of(FOLLOWING, EUTA)) .frequency(Frequency.P12M) .rollConvention(RollConvention.ofDayOfMonth(5)) .build()) .paymentSchedule(PaymentSchedule.builder() .paymentFrequency(Frequency.P12M)
.payReceive(PAY) .accrualSchedule(PeriodicSchedule.builder() .startDate(date(2003, 11, 20)) .endDate(date(2007, 11, 20)) .businessDayAdjustment(BusinessDayAdjustment.of(MODIFIED_FOLLOWING, EUTA)) .overrideStartDate(AdjustableDate.of(date(2003, 11, 12), BusinessDayAdjustment.of(MODIFIED_FOLLOWING, EUTA))) .frequency(Frequency.P12M) .rollConvention(RollConventions.DAY_20) .build()) .paymentSchedule(PaymentSchedule.builder() .paymentFrequency(Frequency.P12M) .payReceive(RECEIVE) .accrualSchedule(PeriodicSchedule.builder() .startDate(date(2003, 11, 20)) .endDate(date(2007, 11, 20)) .businessDayAdjustment(BusinessDayAdjustment.of(MODIFIED_FOLLOWING, EUTA)) .overrideStartDate(AdjustableDate.of(date(2003, 11, 12), BusinessDayAdjustment.of(MODIFIED_FOLLOWING, EUTA))) .frequency(Frequency.P3M) .rollConvention(RollConventions.DAY_20) .build()) .paymentSchedule(PaymentSchedule.builder() .paymentFrequency(Frequency.P12M)
.payReceive(PayReceive.PAY) .accrualSchedule(PeriodicSchedule.builder() .startDate(date(1994, 12, 14)) .endDate(date(1999, 12, 14)) .startDateBusinessDayAdjustment(BusinessDayAdjustment.NONE) .businessDayAdjustment(BusinessDayAdjustment.of(MODIFIED_FOLLOWING, FRPA)) .frequency(Frequency.P6M) .rollConvention(RollConvention.ofDayOfMonth(14)) .build()) .paymentSchedule(PaymentSchedule.builder() .paymentFrequency(Frequency.P6M) .payReceive(PayReceive.RECEIVE) .accrualSchedule(PeriodicSchedule.builder() .startDate(date(1994, 12, 14)) .endDate(date(1999, 12, 14)) .startDateBusinessDayAdjustment(BusinessDayAdjustment.NONE) .businessDayAdjustment(BusinessDayAdjustment.of(MODIFIED_FOLLOWING, FRPA)) .frequency(Frequency.P12M) .rollConvention(RollConvention.ofDayOfMonth(14)) .build()) .paymentSchedule(PaymentSchedule.builder() .paymentFrequency(Frequency.P12M)
.payReceive(RECEIVE) .accrualSchedule(PeriodicSchedule.builder() .startDate(date(2000, 4, 27)) .endDate(date(2002, 4, 27)) .startDateBusinessDayAdjustment(BusinessDayAdjustment.NONE) .businessDayAdjustment(BusinessDayAdjustment.of(MODIFIED_FOLLOWING, GBLO_USNY)) .frequency(Frequency.P3M) .rollConvention(RollConvention.ofDayOfMonth(27)) .build()) .paymentSchedule(PaymentSchedule.builder() .paymentFrequency(Frequency.P6M) .payReceive(PAY) .accrualSchedule(PeriodicSchedule.builder() .startDate(date(2000, 4, 27)) .endDate(date(2002, 4, 27)) .startDateBusinessDayAdjustment(BusinessDayAdjustment.NONE) .businessDayAdjustment(BusinessDayAdjustment.of(MODIFIED_FOLLOWING, GBLO_USNY)) .frequency(Frequency.P6M) .rollConvention(RollConvention.ofDayOfMonth(27)) .build()) .paymentSchedule(PaymentSchedule.builder() .paymentFrequency(Frequency.P6M)
.payReceive(PAY) .accrualSchedule(PeriodicSchedule.builder() .startDate(date(2009, 8, 30)) .endDate(date(2011, 8, 30)) .startDateBusinessDayAdjustment(BusinessDayAdjustment.NONE) .businessDayAdjustment(BusinessDayAdjustment.of(MODIFIED_FOLLOWING, USNY)) .frequency(Frequency.P3M) .rollConvention(RollConvention.ofDayOfMonth(30)) .build()) .paymentSchedule(PaymentSchedule.builder() .paymentFrequency(Frequency.P3M) .payReceive(RECEIVE) .accrualSchedule(PeriodicSchedule.builder() .startDate(date(2009, 8, 30)) .endDate(date(2011, 8, 30)) .startDateBusinessDayAdjustment(BusinessDayAdjustment.NONE) .businessDayAdjustment(BusinessDayAdjustment.of(MODIFIED_FOLLOWING, USNY)) .frequency(Frequency.P6M) .rollConvention(RollConvention.ofDayOfMonth(30)) .build()) .paymentSchedule(PaymentSchedule.builder() .paymentFrequency(Frequency.P6M)
accrualScheduleBuilder.businessDayAdjustment(bda); accrualScheduleBuilder.startDate(startDate.getUnadjusted()); if (!bda.equals(startDate.getAdjustment())) { accrualScheduleBuilder.startDateBusinessDayAdjustment(startDate.getAdjustment()); .map(el -> document.parseAdjustableDate(el)) .orElseGet(() -> document.parseAdjustedRelativeDateOffset(calcPeriodDatesEl.getChild("relativeTerminationDate"))); accrualScheduleBuilder.endDate(endDate.getUnadjusted()); if (!bda.equals(endDate.getAdjustment())) { accrualScheduleBuilder.endDateBusinessDayAdjustment(endDate.getAdjustment()); accrualScheduleBuilder.overrideStartDate(document.parseAdjustableDate(el)); }); accrualScheduleBuilder.firstRegularStartDate(document.parseDate(el)); }); accrualScheduleBuilder.lastRegularEndDate(document.parseDate(el)); }); accrualScheduleBuilder.stubConvention(parseStubConvention(el, document)); }); accrualScheduleBuilder.frequency(accrualFreq); accrualScheduleBuilder.rollConvention( document.convertRollConvention(freqEl.getChild("rollConvention").getContent())); return accrualScheduleBuilder.build();
.payReceive(PAY) .accrualSchedule(PeriodicSchedule.builder() .startDate(date(2005, 2, 22)) .endDate(date(2035, 2, 22)) .businessDayAdjustment(BusinessDayAdjustment.of(MODIFIED_FOLLOWING, GBLO)) .frequency(Frequency.P12M) .rollConvention(RollConventions.NONE) .build()) .paymentSchedule(PaymentSchedule.builder() .paymentFrequency(Frequency.TERM) .payReceive(RECEIVE) .accrualSchedule(PeriodicSchedule.builder() .startDate(date(2005, 2, 22)) .endDate(date(2035, 2, 22)) .startDateBusinessDayAdjustment(BusinessDayAdjustment.of(MODIFIED_FOLLOWING, GBLO)) .businessDayAdjustment(BusinessDayAdjustment.NONE) .endDateBusinessDayAdjustment(BusinessDayAdjustment.of(MODIFIED_FOLLOWING, GBLO)) .frequency(Frequency.P3M) .rollConvention(RollConvention.ofDayOfMonth(22)) .build()) .paymentSchedule(PaymentSchedule.builder() .paymentFrequency(Frequency.TERM)
.paymentSchedule( cdsIndex.getPaymentSchedule().toBuilder() .rollConvention(RollConventions.DAY_20) .startDateBusinessDayAdjustment(cdsIndex.getPaymentSchedule().getBusinessDayAdjustment()) .build()) .build(); CdsIndexTrade expected = CdsIndexTrade.builder() .paymentSchedule( cdsIndex.getPaymentSchedule().toBuilder() .rollConvention(RollConventions.DAY_20) .startDateBusinessDayAdjustment(cdsIndex1.getPaymentSchedule().getBusinessDayAdjustment()) .build()) .build(); CdsIndexTrade expected1 = CdsIndexTrade.builder()
.payReceive(PAY) .accrualSchedule(PeriodicSchedule.builder() .startDate(date(2001, 1, 29)) .endDate(date(2001, 4, 29)) .startDateBusinessDayAdjustment(BusinessDayAdjustment.NONE) .businessDayAdjustment(BusinessDayAdjustment.of(MODIFIED_FOLLOWING, EUTA)) .frequency(Frequency.TERM) .rollConvention(RollConventions.NONE) .build()) .paymentSchedule(PaymentSchedule.builder() .paymentFrequency(Frequency.TERM) .payReceive(RECEIVE) .accrualSchedule(PeriodicSchedule.builder() .startDate(date(2001, 1, 29)) .endDate(date(2001, 4, 29)) .startDateBusinessDayAdjustment(BusinessDayAdjustment.NONE) .businessDayAdjustment(BusinessDayAdjustment.of(MODIFIED_FOLLOWING, EUTA)) .frequency(Frequency.TERM) .rollConvention(RollConventions.NONE) .build()) .paymentSchedule(PaymentSchedule.builder() .paymentFrequency(Frequency.TERM)
.payReceive(PAY) .accrualSchedule(PeriodicSchedule.builder() .startDate(LocalDate.of(2014, 9, 12)) .endDate(LocalDate.of(2021, 9, 12)) .frequency(P12M) .businessDayAdjustment(BDA_MF) .build()) .paymentSchedule(PaymentSchedule.builder() .paymentFrequency(TERM) .payReceive(RECEIVE) .accrualSchedule(PeriodicSchedule.builder() .startDate(LocalDate.of(2014, 9, 12)) .endDate(LocalDate.of(2021, 9, 12)) .frequency(P3M) .businessDayAdjustment(BDA_MF) .stubConvention(StubConvention.SHORT_INITIAL) .build()) .paymentSchedule(PaymentSchedule.builder() .paymentFrequency(TERM)
.payReceive(payReceive) .accrualSchedule(PeriodicSchedule.builder() .startDate(startDate) .endDate(endDate) .frequency(getAccrualFrequency()) .businessDayAdjustment(getAccrualBusinessDayAdjustment()) .startDateBusinessDayAdjustment(startDateBusinessDayAdjustment) .endDateBusinessDayAdjustment(endDateBusinessDayAdjustment) .stubConvention(stubConvention) .rollConvention(rollConvention) .build()) .paymentSchedule(PaymentSchedule.builder() .paymentFrequency(getPaymentFrequency())