CouponFixedDefinition extends CouponDefinition { public static CouponFixedDefinition from(final Currency currency, final ZonedDateTime paymentDate, final ZonedDateTime accrualStartDate, final ZonedDateTime accrualEndDate, final double paymentYearFraction, final double notional, final double rate) { return new CouponFixedDefinition(currency, paymentDate, accrualStartDate, accrualEndDate, paymentYearFraction, notional, rate); } CouponFixedDefinition(final Currency currency, final ZonedDateTime paymentDate, final ZonedDateTime accrualStartDate, final ZonedDateTime accrualEndDate,
      final double paymentYearFraction, final double notional, final double rate);  CouponFixedDefinition(final CouponDefinition coupon, final double rate); static CouponFixedDefinition from(final Currency currency, final ZonedDateTime paymentDate, final ZonedDateTime accrualStartDate,
      final ZonedDateTime accrualEndDate, final double paymentYearFraction, final double notional, final double rate); static CouponFixedDefinition from(final CouponFloatingDefinition floatingCoupon, final double fixedRate); static CouponFixedDefinition from(final CouponIborSpreadDefinition floatingCoupon, final double fixedRate); static CouponFixedDefinition from(final ZonedDateTime startDate, final Period tenor, final GeneratorDeposit generator, final double notional,
      final double fixedRate); double getRate(); double getAmount(); CouponFixedDefinition withNotional(final double notional); CouponFixedDefinition withRate(final double rate); @Override String toString(); @Override int hashCode(); @Override boolean equals(final Object obj); @Override CouponFixed toDerivative(final ZonedDateTime date); @Override V accept(final InstrumentDefinitionVisitor<U, V> visitor, final U data); @Override V accept(final InstrumentDefinitionVisitor<?, V> visitor);  }
@Test public void fromGeneratorDeposit() { final GeneratorDeposit generator = new USDDeposit(CALENDAR); final Period tenor = Period.ofMonths(3); final CouponFixedDefinition cpnFixed = CouponFixedDefinition.from(ACCRUAL_START_DATE, tenor, generator, NOTIONAL, RATE); final ZonedDateTime endDate = ScheduleCalculator.getAdjustedDate(ACCRUAL_START_DATE, tenor, generator.getBusinessDayConvention(), CALENDAR, generator.isEndOfMonth()); final double accrual = generator.getDayCount().getDayCountFraction(ACCRUAL_START_DATE, endDate); final CouponFixedDefinition cpnExpected = new CouponFixedDefinition(generator.getCurrency(), endDate, ACCRUAL_START_DATE, endDate, accrual, NOTIONAL, RATE); assertEquals("CouponFixedDefinition: from deposit generator", cpnExpected, cpnFixed); }