class ForexSwapDefinition implements InstrumentDefinition<InstrumentDerivative> {

  @Override
  public InstrumentDerivative toDerivative(final ZonedDateTime date) {
    ArgumentChecker.isTrue(!date.isAfter(_farLeg.getExchangeDate()), "date is after payment far date");
    if (date.isAfter(_nearLeg.getExchangeDate())) { // Implementation note: only the far leg left.
      return _farLeg.toDerivative(date);
    }
    final Forex nearLeg = _nearLeg.toDerivative(date);
    final Forex farLeg = _farLeg.toDerivative(date);
    return new ForexSwap(nearLeg, farLeg);
  }

  public  ForexSwapDefinition(final ForexDefinition nearLeg, final ForexDefinition farLeg);
  public  ForexSwapDefinition(final Currency currency1, final Currency currency2, final ZonedDateTime nearDate, final ZonedDateTime farDate, final double amount1,
      final double forexRate, final double forwardPoints);

}