CouponIborGearingDefinition extends CouponFloatingDefinition { public static CouponIborGearingDefinition from(final CouponIborDefinition couponIbor, final double spread, final double factor) { ArgumentChecker.notNull(couponIbor, "Ibor coupon"); return new CouponIborGearingDefinition(couponIbor.getCurrency(), couponIbor.getPaymentDate(), couponIbor.getAccrualStartDate(), couponIbor.getAccrualEndDate(), couponIbor.getPaymentYearFraction(), couponIbor.getNotional(), couponIbor.getFixingDate(), couponIbor.getIndex(), spread, factor, couponIbor.getCalendar()); } CouponIborGearingDefinition(final Currency currency, final ZonedDateTime paymentDate, final ZonedDateTime accrualStartDate, final ZonedDateTime accrualEndDate, final double accrualFactor,
      final double notional, final ZonedDateTime fixingDate, final IborIndex index, final double spread, final double factor, final Calendar calendar);  CouponIborGearingDefinition(
      Currency currency,
      ZonedDateTime paymentDate,
      ZonedDateTime accrualStartDate,
      ZonedDateTime accrualEndDate,
      double accrualFactor,
      double notional,
      ZonedDateTime fixingDate,
      IborIndex index,
      ZonedDateTime fixingPeriodStartDate,
      ZonedDateTime fixingPeriodEndDate,
      double fixingPeriodAccrualFactor,
      double spread,
      double factor); static CouponIborGearingDefinition from(final CouponIborDefinition couponIbor, final double spread, final double factor); static CouponIborGearingDefinition from(final ZonedDateTime accrualStartDate, final ZonedDateTime accrualEndDate, final double accrualFactor, final double notional, final IborIndex index,
      final double spread, final double factor, final Calendar calendar); IborIndex getIndex(); ZonedDateTime getFixingPeriodStartDate(); ZonedDateTime getFixingPeriodEndDate(); double getFixingPeriodAccrualFactor(); double getSpread(); double getSpreadAmount(); double getFactor(); @Override CouponIborGearing toDerivative(final ZonedDateTime dateTime); @Override Coupon toDerivative(final ZonedDateTime dateTime, final DoubleTimeSeries<ZonedDateTime> indexFixingTimeSeries); @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 fromCouponIbor() { final CouponIborDefinition couponIbor = new CouponIborDefinition(CUR, ACCRUAL_END_DATE, ACCRUAL_START_DATE, ACCRUAL_END_DATE, ACCRUAL_FACTOR, NOTIONAL, FIXING_DATE, INDEX, CALENDAR); final CouponIborGearingDefinition couponFrom = CouponIborGearingDefinition.from(couponIbor, SPREAD, FACTOR); assertEquals(COUPON_DEFINITION, couponFrom); }
@Test public void fromFinancial() { final CouponIborGearingDefinition couponFrom = CouponIborGearingDefinition.from(ACCRUAL_START_DATE, ACCRUAL_END_DATE, ACCRUAL_FACTOR, NOTIONAL, INDEX, SPREAD, FACTOR, CALENDAR); assertEquals(COUPON_DEFINITION, couponFrom); }