AnnuityCouponFixedDefinition extends AnnuityDefinition<CouponFixedDefinition> { public static AnnuityCouponFixedDefinition fromAccrualUnadjusted(final Currency currency, final ZonedDateTime settlementDate, final ZonedDateTime maturityDate, final Period period, final boolean stubShort, final boolean fromEnd, final Calendar calendar, final DayCount dayCount, final BusinessDayConvention businessDay, final boolean isEOM, final double notional, final double fixedRate, final boolean isPayer) { ArgumentChecker.notNull(currency, "currency"); ArgumentChecker.notNull(settlementDate, "settlement date"); ArgumentChecker.notNull(maturityDate, "maturity date"); ArgumentChecker.notNull(period, "period"); ArgumentChecker.notNull(calendar, "calendar"); ArgumentChecker.notNull(dayCount, "day count"); ArgumentChecker.notNull(businessDay, "business day convention"); ArgumentChecker.isTrue(!(dayCount instanceof ActualActualICMA) | !(dayCount instanceof ActualActualICMANormal), "Coupon per year required for Actua lActual ICMA"); final double sign = isPayer ? -1.0 : 1.0; final ZonedDateTime[] paymentDatesUnadjusted = ScheduleCalculator.getUnadjustedDateSchedule(settlementDate, maturityDate, period, stubShort, fromEnd); final ZonedDateTime[] paymentDates = ScheduleCalculator.getAdjustedDateSchedule(paymentDatesUnadjusted, businessDay, calendar); final CouponFixedDefinition[] coupons = new CouponFixedDefinition[paymentDates.length]; coupons[0] = new CouponFixedDefinition(currency, paymentDates[0], settlementDate, paymentDatesUnadjusted[0], dayCount.getDayCountFraction(settlementDate, paymentDates[0], calendar), sign * notional, fixedRate); for (int loopcpn = 1; loopcpn < paymentDates.length; loopcpn++) { coupons[loopcpn] = new CouponFixedDefinition(currency, paymentDates[loopcpn], paymentDatesUnadjusted[loopcpn - 1], paymentDatesUnadjusted[loopcpn], dayCount.getDayCountFraction(paymentDatesUnadjusted[loopcpn - 1], paymentDatesUnadjusted[loopcpn], calendar), sign * notional, fixedRate); } return new AnnuityCouponFixedDefinition(coupons, calendar); } AnnuityCouponFixedDefinition(final CouponFixedDefinition[] payments, final Calendar calendar); static AnnuityCouponFixedDefinition from(final Currency currency, final ZonedDateTime settlementDate, final Period tenor, final Period paymentPeriod, final Calendar calendar,
      final DayCount dayCount, final BusinessDayConvention businessDay, final boolean isEOM, final double notional, final double fixedRate, final boolean isPayer); static AnnuityCouponFixedDefinition from(final Currency currency, final ZonedDateTime settlementDate, final ZonedDateTime maturityDate, final Period paymentPeriod, final Calendar calendar,
      final DayCount dayCount, final BusinessDayConvention businessDay, final boolean isEOM, final double notional, final double fixedRate, final boolean isPayer); static AnnuityCouponFixedDefinition from(final Currency currency, final ZonedDateTime settlementDate, final ZonedDateTime maturityDate, final Period paymentPeriod, final Calendar calendar,
      final DayCount dayCount, final BusinessDayConvention businessDay, final boolean isEOM, final double notional, final double fixedRate, final boolean isPayer, final StubType stub); static AnnuityCouponFixedDefinition from(final Currency currency, final ZonedDateTime settlementDate, final ZonedDateTime maturityDate, final Frequency frequency, final Calendar calendar,
      final DayCount dayCount, final BusinessDayConvention businessDay, final boolean isEOM, final double notional, final double fixedRate, final boolean isPayer); static AnnuityCouponFixedDefinition from(final Currency currency, final ZonedDateTime settlementDate, final ZonedDateTime[] paymentDatesUnadjusted, final Frequency frequency,
      final Calendar calendar, final DayCount dayCount, final BusinessDayConvention businessDay, final boolean isEOM, final double notional, final double fixedRate, final boolean isPayer); static AnnuityCouponFixedDefinition from(final ZonedDateTime settlementDate, final Period tenor, final GeneratorSwapFixedIbor generator, final double notional, final double fixedRate,
      final boolean isPayer); static AnnuityCouponFixedDefinition fromAccrualUnadjusted(final Currency currency, final ZonedDateTime settlementDate, final ZonedDateTime maturityDate, final Period period,
      final boolean stubShort, final boolean fromEnd, final Calendar calendar, final DayCount dayCount, final BusinessDayConvention businessDay, final boolean isEOM, final double notional,
      final double fixedRate, final boolean isPayer); static AnnuityCouponFixedDefinition fromAccrualUnadjusted(final Currency currency, final ZonedDateTime settlementDate, final ZonedDateTime maturityDate, final Period period,
      final int nbPaymentPerYear, final boolean stubShort, final boolean fromEnd, final Calendar calendar, final DayCount dayCount, final BusinessDayConvention businessDay, final boolean isEOM,
      final double notional, final double fixedRate, final boolean isPayer); @Override AnnuityCouponFixedDefinition trimBefore(final ZonedDateTime trimDate); AnnuityCouponFixedDefinition trimStart(final ZonedDateTime trimDate); @Override AnnuityCouponFixed toDerivative(final ZonedDateTime date); AnnuityCouponFixedDefinition withRate(final double rate);  }
@Test(expectedExceptions = IllegalArgumentException.class) public void testStaticConstructionNullCurrency3() { AnnuityCouponFixedDefinition.fromAccrualUnadjusted(null, SETTLEMENT_DATE, MATURITY_DATE, ANNUITY_TENOR, true, true, CALENDAR, DAY_COUNT, BUSINESS_DAY, IS_EOM, NOTIONAL, RATE, IS_PAYER); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testStaticConstructionNullSettlementDate3() { AnnuityCouponFixedDefinition.fromAccrualUnadjusted(CUR, null, MATURITY_DATE, ANNUITY_TENOR, true, true, CALENDAR, DAY_COUNT, BUSINESS_DAY, IS_EOM, NOTIONAL, RATE, IS_PAYER); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testStaticConstructionNullMaturityDate2() { AnnuityCouponFixedDefinition.fromAccrualUnadjusted(CUR, SETTLEMENT_DATE, null, ANNUITY_TENOR, true, true, CALENDAR, DAY_COUNT, BUSINESS_DAY, IS_EOM, NOTIONAL, RATE, IS_PAYER); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testStaticConstructionNullPaymentTenor2() { AnnuityCouponFixedDefinition.fromAccrualUnadjusted(CUR, SETTLEMENT_DATE, MATURITY_DATE, null, true, true, CALENDAR, DAY_COUNT, BUSINESS_DAY, IS_EOM, NOTIONAL, RATE, IS_PAYER); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testStaticConstructionNullCalendar3() { AnnuityCouponFixedDefinition.fromAccrualUnadjusted(CUR, SETTLEMENT_DATE, MATURITY_DATE, ANNUITY_TENOR, true, true, null, DAY_COUNT, BUSINESS_DAY, IS_EOM, NOTIONAL, RATE, IS_PAYER); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testStaticConstructionNullDayCount3() { AnnuityCouponFixedDefinition.fromAccrualUnadjusted(CUR, SETTLEMENT_DATE, MATURITY_DATE, ANNUITY_TENOR, true, true, CALENDAR, null, BUSINESS_DAY, IS_EOM, NOTIONAL, RATE, IS_PAYER); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testStaticConstructionNullBusinessDay3() { AnnuityCouponFixedDefinition.fromAccrualUnadjusted(CUR, SETTLEMENT_DATE, MATURITY_DATE, ANNUITY_TENOR, true, true, CALENDAR, DAY_COUNT, null, IS_EOM, NOTIONAL, RATE, IS_PAYER); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testStaticConstructionNullCurrency4() { AnnuityCouponFixedDefinition.fromAccrualUnadjusted(null, SETTLEMENT_DATE, MATURITY_DATE, ANNUITY_TENOR, 2, true, true, CALENDAR, DAY_COUNT, BUSINESS_DAY, IS_EOM, NOTIONAL, RATE, IS_PAYER); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testStaticConstructionNullSettlementDate4() { AnnuityCouponFixedDefinition.fromAccrualUnadjusted(CUR, null, MATURITY_DATE, ANNUITY_TENOR, 2, true, true, CALENDAR, DAY_COUNT, BUSINESS_DAY, IS_EOM, NOTIONAL, RATE, IS_PAYER); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testStaticConstructionNullMaturityDate3() { AnnuityCouponFixedDefinition.fromAccrualUnadjusted(CUR, SETTLEMENT_DATE, null, ANNUITY_TENOR, 2, true, true, CALENDAR, DAY_COUNT, BUSINESS_DAY, IS_EOM, NOTIONAL, RATE, IS_PAYER); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testStaticConstructionNullPaymentTenor3() { AnnuityCouponFixedDefinition.fromAccrualUnadjusted(CUR, SETTLEMENT_DATE, MATURITY_DATE, null, 2, true, true, CALENDAR, DAY_COUNT, BUSINESS_DAY, IS_EOM, NOTIONAL, RATE, IS_PAYER); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testStaticConstructionPaymentsPerYear() { AnnuityCouponFixedDefinition.fromAccrualUnadjusted(CUR, SETTLEMENT_DATE, MATURITY_DATE, ANNUITY_TENOR, -2, true, true, null, DAY_COUNT, BUSINESS_DAY, IS_EOM, NOTIONAL, RATE, IS_PAYER); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testStaticConstructionNullCalendar4() { AnnuityCouponFixedDefinition.fromAccrualUnadjusted(CUR, SETTLEMENT_DATE, MATURITY_DATE, ANNUITY_TENOR, 2, true, true, null, DAY_COUNT, BUSINESS_DAY, IS_EOM, NOTIONAL, RATE, IS_PAYER); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testStaticConstructionNullDayCount4() { AnnuityCouponFixedDefinition.fromAccrualUnadjusted(CUR, SETTLEMENT_DATE, MATURITY_DATE, ANNUITY_TENOR, 2, true, true, CALENDAR, null, BUSINESS_DAY, IS_EOM, NOTIONAL, RATE, IS_PAYER); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testStaticConstructionNullBusinessDay4() { AnnuityCouponFixedDefinition.fromAccrualUnadjusted(CUR, SETTLEMENT_DATE, MATURITY_DATE, ANNUITY_TENOR, 2, true, true, CALENDAR, DAY_COUNT, null, IS_EOM, NOTIONAL, RATE, IS_PAYER); }