InterestRateSwapNotional extends InterestRateNotional { public static InterestRateSwapNotional of(Currency ccy, final List<LocalDate> dates, final List<Double> notionals, List<Rate.ShiftType> types) { ArgumentChecker.noNulls(dates, "dates"); ArgumentChecker.noNulls(notionals, "notionals"); ArgumentChecker.noNulls(types, "types"); ArgumentChecker.isTrue(dates.size() == notionals.size(), "Different numbers of overrides & notionals"); ArgumentChecker.isTrue(dates.size() == types.size(), "Different numbers of overrides & notionals"); ArgumentChecker.isTrue(notionals.size() > 0, "Require at least one notional"); if (notionals.size() == 1) { return new InterestRateSwapNotional(ccy, notionals.get(0)); } ArgumentChecker.isTrue(types.get(0) == Rate.ShiftType.OUTRIGHT, "First notional in schedule must be an OUTRIGHT quote"); return new InterestRateSwapNotional(ccy, dates, notionals, types); } private  InterestRateSwapNotional(Currency ccy, List<LocalDate> overridePeriods, List<Double> notionals, List<Rate.ShiftType> types);  InterestRateSwapNotional(final Currency ccy, final double notional); protected  InterestRateSwapNotional(); T accept(InterestRateSwapNotionalVisitor<LocalDate, T> visitor, LocalDate period); T accept(InterestRateSwapNotionalVisitor<Object , T> visitor); @Deprecated @Override double getAmount(); double getInitialAmount(); double getAmount(final LocalDate date); static InterestRateSwapNotional of(Currency ccy, final List<LocalDate> dates, final List<Double> notionals, List<Rate.ShiftType> types); static InterestRateSwapNotional of(Currency ccy, final List<LocalDate> dates, final List<Double> notionals); static InterestRateSwapNotional of(Currency ccy, final double notional); static InterestRateSwapNotional.Meta meta(); @Override InterestRateSwapNotional.Meta metaBean(); List<LocalDate> getDates(); void setDates(List<LocalDate> dates); Property<List<LocalDate>> dates(); List<Double> getNotionals(); void setNotionals(List<Double> notionals); Property<List<Double>> notionals(); List<Rate.ShiftType> getShiftTypes(); void setShiftTypes(List<Rate.ShiftType> shiftTypes); Property<List<Rate.ShiftType>> shiftTypes(); @Override InterestRateSwapNotional clone(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }
@Test(expectedExceptions = IllegalArgumentException.class) public void testDeltaInitialNotional() throws Exception { LocalDate start = LocalDate.now(); List<LocalDate> dates = Lists.newArrayList(start, start.plusYears(1), start.plusYears(2), start.plusYears(3)); List<Double> notionals = Lists.newArrayList(1e6, 1e5, 1e4, 1e3); List<Rate.ShiftType> shiftTypes = Lists.newArrayList(Rate.ShiftType.DELTA, Rate.ShiftType.OUTRIGHT, Rate.ShiftType.OUTRIGHT, Rate.ShiftType.OUTRIGHT); InterestRateSwapNotional.of(Currency.GBP, dates, notionals, shiftTypes); }