CouponInflationZeroCouponInterpolationDefinition extends CouponInflationDefinition { public static CouponInflationZeroCouponInterpolationDefinition from(final Currency currency, final ZonedDateTime paymentDate, final ZonedDateTime accrualStartDate, final ZonedDateTime accrualEndDate, final double paymentYearFraction, final double notional, final IndexPrice priceIndex, final int conventionalMonthLag, final ZonedDateTime[] referenceStartDates, final ZonedDateTime[] referenceEndDates, final boolean payNotional) { ArgumentChecker.notNull(referenceStartDates, "Reference start date"); ArgumentChecker.notNull(referenceEndDates, "Reference end date"); final double weight = 1.0 - (paymentDate.getDayOfMonth() - 1.0) / paymentDate.toLocalDate().lengthOfMonth(); return new CouponInflationZeroCouponInterpolationDefinition(currency, paymentDate, accrualStartDate, accrualEndDate, 1.0, notional, priceIndex, conventionalMonthLag, conventionalMonthLag, referenceStartDates, referenceEndDates, weight, payNotional); } CouponInflationZeroCouponInterpolationDefinition(final Currency currency, final ZonedDateTime paymentDate, final ZonedDateTime accrualStartDate,
      final ZonedDateTime accrualEndDate, final double paymentYearFraction, final double notional, final IndexPrice priceIndex, final int conventionalMonthLag,
      final int monthLag, final ZonedDateTime[] referenceStartDates, final ZonedDateTime[] referenceEndDates, final double weight, final boolean payNotional); static CouponInflationZeroCouponInterpolationDefinition from(final Currency currency, final ZonedDateTime paymentDate, final ZonedDateTime accrualStartDate,
      final ZonedDateTime accrualEndDate, final double paymentYearFraction, final double notional, final IndexPrice priceIndex, final int conventionalMonthLag,
      final ZonedDateTime[] referenceStartDates, final ZonedDateTime[] referenceEndDates, final boolean payNotional); static CouponInflationZeroCouponInterpolationDefinition from(final ZonedDateTime accrualStartDate, final ZonedDateTime paymentDate, final double notional,
      final IndexPrice priceIndex, final int conventionalMonthLag, final int monthLag, final ZonedDateTime[] referenceEndDate, final boolean payNotional); static CouponInflationZeroCouponInterpolationDefinition from(final ZonedDateTime accrualStartDate,
                                                                      final ZonedDateTime paymentDate, final double notional,
      final IndexPrice priceIndex, final int conventionalMonthLag, final int monthLag, final boolean payNotional); ZonedDateTime[] getReferenceStartDates(); ZonedDateTime[] getReferenceEndDates(); double getWeight(); boolean payNotional(); int getConventionalMonthLag(); int getMonthLag(); @Override CouponInflationDefinition with(final ZonedDateTime paymentDate, final ZonedDateTime accrualStartDate, final ZonedDateTime accrualEndDate, final double notional); @Override CouponInflationZeroCouponInterpolation toDerivative(final ZonedDateTime date); @Override Coupon toDerivative(final ZonedDateTime date, final DoubleTimeSeries<ZonedDateTime> priceIndexTimeSeries); @Override V accept(final InstrumentDefinitionVisitor<U, V> visitor, final U data); @Override V accept(final InstrumentDefinitionVisitor<?, V> visitor); @Override String toString(); @Override int hashCode(); @Override boolean equals(final Object obj);  }
@Test public void from() { final CouponInflationZeroCouponInterpolationDefinition constructor = new CouponInflationZeroCouponInterpolationDefinition(CUR, PAYMENT_DATE, START_DATE, PAYMENT_DATE, 1.0, NOTIONAL, PRICE_INDEX_EUR, MONTH_LAG, MONTH_LAG, REFERENCE_START_DATE, REFERENCE_END_DATE, WEIGHT, false); final CouponInflationZeroCouponInterpolationDefinition from = CouponInflationZeroCouponInterpolationDefinition.from(CUR, PAYMENT_DATE, START_DATE, PAYMENT_DATE, 1.0, NOTIONAL, PRICE_INDEX_EUR, MONTH_LAG, REFERENCE_START_DATE, REFERENCE_END_DATE, false); assertEquals("Inflation zero-coupon : from", constructor, from); }
@Test public void from1() { final CouponInflationZeroCouponInterpolationDefinition constructor = new CouponInflationZeroCouponInterpolationDefinition(CUR, PAYMENT_DATE, START_DATE, PAYMENT_DATE, 1.0, NOTIONAL, PRICE_INDEX_EUR, MONTH_LAG, MONTH_LAG, REFERENCE_START_DATE, REFERENCE_END_DATE, WEIGHT, false); final CouponInflationZeroCouponInterpolationDefinition from = CouponInflationZeroCouponInterpolationDefinition.from(START_DATE, PAYMENT_DATE, NOTIONAL, PRICE_INDEX_EUR, MONTH_LAG, MONTH_LAG, REFERENCE_END_DATE, false); assertEquals("Inflation zero-coupon : from", constructor, from); }
@Test public void from2() { final CouponInflationZeroCouponInterpolationDefinition constructor = new CouponInflationZeroCouponInterpolationDefinition(CUR, PAYMENT_DATE, START_DATE, PAYMENT_DATE, 1.0, NOTIONAL, PRICE_INDEX_EUR, MONTH_LAG, MONTH_LAG, REFERENCE_START_DATE, REFERENCE_END_DATE, WEIGHT, false); final CouponInflationZeroCouponInterpolationDefinition from = CouponInflationZeroCouponInterpolationDefinition.from(START_DATE, PAYMENT_DATE, NOTIONAL, PRICE_INDEX_EUR, MONTH_LAG, MONTH_LAG, false); assertEquals("Inflation zero-coupon : from", constructor, from); }
@Test public void from3() { final CouponInflationZeroCouponInterpolationDefinition constructor = new CouponInflationZeroCouponInterpolationDefinition(CUR, PAYMENT_DATE, START_DATE, PAYMENT_DATE, 1.0, NOTIONAL, PRICE_INDEX_EUR, MONTH_LAG, MONTH_LAG, REFERENCE_START_DATE, REFERENCE_END_DATE, WEIGHT, false); final CouponInflationZeroCouponInterpolationDefinition from = CouponInflationZeroCouponInterpolationDefinition .from(START_DATE, PAYMENT_DATE, NOTIONAL, PRICE_INDEX_EUR, MONTH_LAG, MONTH_LAG, false); assertEquals("Inflation zero-coupon : from", constructor, from); }