CapFloorInflationZeroCouponMonthlyDefinition extends CouponInflationDefinition implements CapFloor { public static CapFloorInflationZeroCouponMonthlyDefinition from(final ZonedDateTime accrualStartDate, final ZonedDateTime paymentDate, final double notional, final IndexPrice priceIndex, final int conventionalMonthLag, final int monthLag, final int maturity, final ZonedDateTime lastKnownFixingDate, final ZonedDateTime referenceStartDate, final ZonedDateTime referenceEndDate, final double strike, final boolean isCap) { Validate.notNull(priceIndex, "Price index"); return new CapFloorInflationZeroCouponMonthlyDefinition(priceIndex.getCurrency(), paymentDate, accrualStartDate, paymentDate, 1.0, notional, priceIndex, lastKnownFixingDate, conventionalMonthLag, monthLag, maturity, referenceStartDate, referenceEndDate, strike, isCap); } CapFloorInflationZeroCouponMonthlyDefinition(final Currency currency, final ZonedDateTime paymentDate, final ZonedDateTime accrualStartDate,
      final ZonedDateTime accrualEndDate, final double paymentYearFraction, final double notional, final IndexPrice priceIndex, final ZonedDateTime lastKnownFixingDate,
      final int conventionalMonthLag, final int monthLag, final int maturity, final ZonedDateTime referenceStartDate,
      final ZonedDateTime referenceEndDate, final double strike, final boolean isCap); static CapFloorInflationZeroCouponMonthlyDefinition from(final ZonedDateTime accrualStartDate, final ZonedDateTime paymentDate, final double notional,
      final IndexPrice priceIndex, final int conventionalMonthLag, final int monthLag, final int maturity, final ZonedDateTime lastKnownFixingDate, final ZonedDateTime referenceStartDate,
      final ZonedDateTime referenceEndDate, final double strike, final boolean isCap); static CapFloorInflationZeroCouponMonthlyDefinition from(final ZonedDateTime accrualStartDate, final ZonedDateTime paymentDate, final double notional,
      final IndexPrice priceIndex, final int conventionalMonthLag, final int monthLag, final int maturity, final ZonedDateTime lastKnownFixingDate, final double strike,
      final boolean isCap); static CapFloorInflationZeroCouponMonthlyDefinition from(final CouponInflationZeroCouponMonthlyDefinition couponInflation, final ZonedDateTime lastKnownFixingDate, final int maturity,
      final double strike, final boolean isCap); ZonedDateTime getlastKnownFixingDate(); ZonedDateTime getReferenceStartDate(); ZonedDateTime getReferenceEndDate(); int getConventionalMonthLag(); int getMonthLag(); int getMaturity(); @Override double getStrike(); @Override boolean isCap(); @Override CouponInflationDefinition with(final ZonedDateTime paymentDate, final ZonedDateTime accrualStartDate, final ZonedDateTime accrualEndDate, final double notional); @Override double payOff(final double fixing); @Override CapFloorInflationZeroCouponMonthly 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 CapFloorInflationZeroCouponMonthlyDefinition constructor = new CapFloorInflationZeroCouponMonthlyDefinition(CUR, PAYMENT_DATE, ACCRUAL_START_DATE, ACCRUAL_END_DATE, 1.0, NOTIONAL, PRICE_INDEX, LAST_KNOWN_FIXING_DATE, MONTH_LAG, 3, MATURITY, REFERENCE_START_DATE, REFERENCE_END_DATE, STRIKE, IS_CAP); final CouponInflationZeroCouponMonthlyDefinition zeroCoupon = new CouponInflationZeroCouponMonthlyDefinition(CUR, PAYMENT_DATE, ACCRUAL_START_DATE, ACCRUAL_END_DATE, 1.0, NOTIONAL, PRICE_INDEX, MONTH_LAG, 3, REFERENCE_START_DATE, REFERENCE_END_DATE, false); final CapFloorInflationZeroCouponMonthlyDefinition from = CapFloorInflationZeroCouponMonthlyDefinition.from(zeroCoupon, LAST_KNOWN_FIXING_DATE, MATURITY, STRIKE, IS_CAP); assertEquals("Inflation zero-coupon : from", constructor, from); }