@ImmutableValidator private void validate() { ArgChecker.inOrderNotEqual(unadjustedStartDate, unadjustedEndDate, "unadjustedStartDate", "unadjustedEndDate"); ArgChecker.inOrderNotEqual(startDate, endDate, "startDate", "endDate"); }
@ImmutableValidator private void validate() { // check for unadjusted must be after firstNonNull ArgChecker.inOrderNotEqual(startDate, endDate, "startDate", "endDate"); ArgChecker.inOrderNotEqual(unadjustedStartDate, unadjustedEndDate, "unadjustedStartDate", "unadjustedEndDate"); }
@ImmutableValidator private void validate() { // check for unadjusted must be after firstNonNull ArgChecker.inOrderNotEqual(startDate, endDate, "startDate", "endDate"); ArgChecker.inOrderNotEqual(unadjustedStartDate, unadjustedEndDate, "unadjustedStartDate", "unadjustedEndDate"); }
private static void checkSortedDates(List<LocalDate> dates) { for (int loopdate = 0; loopdate < dates.size() - 1; loopdate++) { ArgChecker.inOrderNotEqual(dates.get(loopdate), dates.get(loopdate + 1), "first date", "following date"); } }
@ImmutableValidator private void validate() { ArgChecker.inOrderNotEqual(startDate, endDate, "startDate", "endDate"); if (index.equals(indexInterpolated)) { throw new IllegalArgumentException("Interpolation requires two different indices"); } }
@ImmutableValidator private void validate() { if (firstRegularStartDate != null && lastRegularEndDate != null) { ArgChecker.inOrderNotEqual( firstRegularStartDate, lastRegularEndDate, "firstPaymentDate", "lastRegularPaymentDate"); } }
@ImmutableValidator private void validate() { ArgChecker.inOrderNotEqual(startDate, endDate, "startDate", "endDate"); }
@ImmutableValidator private void validate() { ArgChecker.inOrderNotEqual(startDate, endDate, "startDate", "endDate"); }
/** * Obtains a template based on the specified dates and convention. * * @param startDate the start date * @param endDate the end date * @param convention the convention * @return the template */ public static DatesCdsTemplate of(LocalDate startDate, LocalDate endDate, CdsConvention convention) { ArgChecker.inOrderNotEqual(startDate, endDate, "startDate", "endDate"); return new DatesCdsTemplate(startDate, endDate, convention); }
@ImmutableValidator private void validate() { ArgChecker.inOrderNotEqual(startDate, endDate, "startDate", "endDate"); }
@ImmutableValidator private void validate() { ArgChecker.inOrderNotEqual(startDate, endDate, "startDate", "endDate"); }
public void test_inOrderNotEqual_true() { LocalDate a = LocalDate.of(2011, 7, 2); LocalDate b = LocalDate.of(2011, 7, 3); ArgChecker.inOrderNotEqual(a, b, "a", "b"); }
@Override public PointSensitivityBuilder periodRatePointSensitivity( OvernightIndexObservation startDateObservation, LocalDate endDate) { LocalDate startDate = startDateObservation.getEffectiveDate(); ArgChecker.inOrderNotEqual(startDate, endDate, "startDate", "endDate"); return OvernightRateSensitivity.ofPeriod(startDateObservation, endDate, 1d); }
@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = ".*a.* [<] .*b.*") public void test_inOrderNotEqual_false_equal() { LocalDate a = LocalDate.of(2011, 7, 3); ArgChecker.inOrderNotEqual(a, a, "a", "b"); }
@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = ".*a.* [<] .*b.*") public void test_inOrderNotEqual_false_invalidOrder() { LocalDate a = LocalDate.of(2011, 7, 2); LocalDate b = LocalDate.of(2011, 7, 3); ArgChecker.inOrderNotEqual(b, a, "a", "b"); }
@ImmutableValidator private void validate() { ArgChecker.isTrue( startObservation.getIndex().equals(endObservation.getIndex()), "Both observations must be for the same index"); ArgChecker.inOrderNotEqual( startObservation.getFixingMonth(), endObservation.getFixingMonth(), "referenceStartMonth", "referenceEndMonth"); }
@ImmutableValidator private void validate() { ArgChecker.isTrue( endObservation.getIndex().equals(endSecondObservation.getIndex()), "Both observations must be for the same index"); ArgChecker.inOrderNotEqual( endObservation.getFixingMonth(), endSecondObservation.getFixingMonth(), "endObservation", "endSecondObservation"); }
@Override public double periodRate(OvernightIndexObservation startDateObservation, LocalDate endDate) { LocalDate effectiveDate = startDateObservation.getEffectiveDate(); ArgChecker.inOrderNotEqual(effectiveDate, endDate, "startDate", "endDate"); double accrualFactor = startDateObservation.getIndex().getDayCount().yearFraction(effectiveDate, endDate); return simplyCompoundForwardRate(effectiveDate, endDate, accrualFactor); }
@ImmutableValidator private void validate() { ArgChecker.inOrderNotEqual( nearLeg.getPaymentDate(), farLeg.getPaymentDate(), "nearLeg.paymentDate", "farLeg.paymentDate"); if (!nearLeg.getBaseCurrencyPayment().getCurrency().equals(farLeg.getBaseCurrencyPayment().getCurrency()) || !nearLeg.getCounterCurrencyPayment().getCurrency().equals(farLeg.getCounterCurrencyPayment().getCurrency())) { throw new IllegalArgumentException("Legs must have the same currency pair"); } if (signum(nearLeg.getBaseCurrencyPayment().getAmount()) == signum(farLeg.getBaseCurrencyPayment().getAmount())) { throw new IllegalArgumentException("Legs must have payments flowing in opposite directions"); } }
@ImmutableValidator private void validate() { ArgChecker.inOrderNotEqual( nearLeg.getPaymentDate(), farLeg.getPaymentDate(), "nearLeg.paymentDate", "farLeg.paymentDate"); if (!nearLeg.getBaseCurrencyAmount().getCurrency().equals(farLeg.getBaseCurrencyAmount().getCurrency()) || !nearLeg.getCounterCurrencyAmount().getCurrency().equals(farLeg.getCounterCurrencyAmount().getCurrency())) { throw new IllegalArgumentException("Legs must have the same currency pair"); } if (signum(nearLeg.getBaseCurrencyAmount().getAmount()) == signum(farLeg.getBaseCurrencyAmount().getAmount())) { throw new IllegalArgumentException("Legs must have payments flowing in opposite directions"); } }