class CouponIborFxResetDefinition extends CouponDefinition implements
    InstrumentDefinitionWithData<Payment, DoubleTimeSeries<ZonedDateTime>[]> {

  @Override
  public CouponIborFxReset toDerivative(ZonedDateTime dateTime) {
    ArgumentChecker.notNull(dateTime, "dateTime");
    LocalDate dayConversion = dateTime.toLocalDate();
    ArgumentChecker.isTrue(!dayConversion.isAfter(getIborIndexFixingDate().toLocalDate()),
        "Do not have any fixing data but are asking for a derivative at " + dateTime +
            " which is after ibor index fixing date " + getIborIndexFixingDate());
    ArgumentChecker.isTrue(!dayConversion.isAfter(getPaymentDate().toLocalDate()), "date is after payment date");
    double paymentTime = TimeCalculator.getTimeBetween(dateTime, getPaymentDate());
    double fixingTime = TimeCalculator.getTimeBetween(dateTime, getIborIndexFixingDate());
    double fixingPeriodStartTime = TimeCalculator.getTimeBetween(dateTime, getIborIndexFixingPeriodStartDate());
    double fixingPeriodEndTime = TimeCalculator.getTimeBetween(dateTime, getIborIndexFixingPeriodEndDate());
    double fxFixingTime = TimeCalculator.getTimeBetween(dateTime, _fxFixingDate);
    double fxDeliveryTime = TimeCalculator.getTimeBetween(dateTime, _fxDeliveryDate);
    return new CouponIborFxReset(getCurrency(), paymentTime, getPaymentYearFraction(), getNotional(), fixingTime,
        getIndex(), fixingPeriodStartTime, fixingPeriodEndTime, getIborIndexFixingPeriodAccrualFactor(), _spread,
        getReferenceCurrency(), fxFixingTime, fxDeliveryTime);
  }

  public  CouponIborFxResetDefinition(final Currency currency, final ZonedDateTime paymentDate,
      final ZonedDateTime accrualStartDate, final ZonedDateTime accrualEndDate, final double paymentAccrualFactor,
      final double notional, final ZonedDateTime iborIndexFixingDate, final IborIndex index, final double spread,
      final Calendar calendar, final Currency referenceCurrency, final ZonedDateTime fxFixingDate,
      final ZonedDateTime fxDeliveryDate);
  public  CouponIborFxResetDefinition(final Currency currency, final ZonedDateTime paymentDate,
      final ZonedDateTime accrualStartDate, final ZonedDateTime accrualEndDate, final double paymentAccrualFactor,
      final double notional, final ZonedDateTime iborIndexFixingDate,
      final ZonedDateTime iborIndexFixingPeriodStartDate,
      final ZonedDateTime iborIndexFixingPeriodEndDate, final double iborIndexFixingPeriodAccrualFactor,
      final IborIndex index,
      final double spread, final Calendar calendar, final Currency referenceCurrency, final ZonedDateTime fxFixingDate,
      final ZonedDateTime fxDeliveryDate);

}