SwapXCcyIborIborDefinition extends SwapDefinition { public static SwapXCcyIborIborDefinition from(final ZonedDateTime settlementDate, final Period tenor, final GeneratorSwapXCcyIborIbor generator, final double notional1, final double notional2, final double spread, final boolean isPayer, final Calendar calendar1, final Calendar calendar2) { ArgumentChecker.notNull(settlementDate, "settlement date"); ArgumentChecker.notNull(tenor, "Tenor"); ArgumentChecker.notNull(generator, "Swap generator"); final ZonedDateTime maturityDate = settlementDate.plus(tenor); return from(settlementDate, maturityDate, generator, notional1, notional2, spread, 0.0, isPayer); } SwapXCcyIborIborDefinition(final AnnuityDefinition<CouponDefinition> firstLeg, final AnnuityDefinition<CouponDefinition> secondLeg); static SwapXCcyIborIborDefinition from(final ZonedDateTime settlementDate, final Period tenor, final GeneratorSwapXCcyIborIbor generator, final double notional1, final double notional2,
      final double spread, final boolean isPayer, final Calendar calendar1, final Calendar calendar2); static SwapXCcyIborIborDefinition from(final ZonedDateTime settlementDate, final ZonedDateTime maturityDate, final GeneratorSwapXCcyIborIbor generator, final double notional1,
      final double notional2, final double spread1, final double spread2, final boolean isPayer); @Override V accept(final InstrumentDefinitionVisitor<U, V> visitor, final U data); @Override V accept(final InstrumentDefinitionVisitor<?, V> visitor); @Override Swap<Payment, Payment> toDerivative(final ZonedDateTime date); @Override Swap<Payment, Payment> toDerivative(final ZonedDateTime date, final ZonedDateTimeDoubleTimeSeries[] indexDataTS);  }
@Test(expectedExceptions = IllegalArgumentException.class) public void nullSettleDate() { SwapXCcyIborIborDefinition.from(null, ANNUITY_TENOR, XCCY_GENERATOR, NOTIONAL1, NOTIONAL2, SPREAD_1, IS_PAYER_1, CALENDAR, CALENDAR); }
@Test(expectedExceptions = IllegalArgumentException.class) public void nullTenor() { SwapXCcyIborIborDefinition.from(SETTLEMENT_DATE, null, XCCY_GENERATOR, NOTIONAL1, NOTIONAL2, SPREAD_1, IS_PAYER_1, CALENDAR, CALENDAR); }
@Test(expectedExceptions = IllegalArgumentException.class) public void nullGen() { SwapXCcyIborIborDefinition.from(SETTLEMENT_DATE, ANNUITY_TENOR, null, NOTIONAL1, NOTIONAL2, SPREAD_1, IS_PAYER_1, CALENDAR, CALENDAR); }
@Test public void from2() { final SwapXCcyIborIborDefinition swap2 = SwapXCcyIborIborDefinition.from(SETTLEMENT_DATE, ANNUITY_TENOR, XCCY_GENERATOR, NOTIONAL1, NOTIONAL2, SPREAD_1, IS_PAYER_1, CALENDAR, CALENDAR); assertEquals("SwapXCcyIborIborDefinition", SWAP_XCCY_IBOR_IBOR, swap2); }