/** * Construct the interpolator without clamped points. * @param baseMethod The base interpolator must not be itself */ public ProductPiecewisePolynomialInterpolator(PiecewisePolynomialInterpolator baseMethod) { ArgChecker.notNull(baseMethod, "baseMethod"); ArgChecker.isFalse(baseMethod instanceof ProductPiecewisePolynomialInterpolator, "baseMethod should not be ProductPiecewisePolynomialInterpolator"); _baseMethod = baseMethod; _xValuesClamped = null; _yValuesClamped = null; _isClamped = false; }
public void test_isFalse_ok_args() { ArgChecker.isFalse(false, "Message {} {} {}", "A", 2., 3, true); }
@ImmutableValidator private void validate() { ArgChecker.isTrue(extrapolatorLeft.equals(FLAT), "extrapolator left must be flat extrapolator"); ArgChecker.isTrue( interpolator.equals(CurveInterpolators.LINEAR) || interpolator.equals(CurveInterpolators.STEP_UPPER), "interpolator must be local interpolator"); ArgChecker.isFalse(betaCurve != null && rhoCurve != null, "Only betaCurve or rhoCurve must be set, not both"); ArgChecker.isFalse(betaCurve == null && rhoCurve == null, "Either betaCurve or rhoCurve must be set"); }
@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = "Message A 2 3.0") public void test_isFalse_ok_args_true() { ArgChecker.isFalse(true, "Message {} {} {}", "A", 2, 3.); }
@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = "Message") public void test_isFalse_true() { ArgChecker.isFalse(true, "Message"); }
protected void checkCdsBucket(ResolvedCdsTrade trade, List<ResolvedCdsTrade> bucketCds) { Iterator<StandardId> legalEntities = bucketCds.stream().map(t -> t.getProduct().getLegalEntityId()).collect(Collectors.toSet()).iterator(); ArgChecker.isTrue(legalEntities.next().equals(trade.getProduct().getLegalEntityId()), "legal entity must be common"); ArgChecker.isFalse(legalEntities.hasNext(), "legal entity must be common"); Iterator<Currency> currencies = bucketCds.stream().map(t -> t.getProduct().getCurrency()).collect(Collectors.toSet()).iterator(); ArgChecker.isTrue(currencies.next().equals(trade.getProduct().getCurrency()), "currency must be common"); ArgChecker.isFalse(currencies.hasNext(), "currency must be common"); }
@ImmutableValidator private void validate() { ArgChecker.isFalse(periodToStart.isNegative(), "Period to start must not be negative"); }
@ImmutableValidator private void validate() { ArgChecker.isFalse(depositPeriod.isNegative(), "Deposit Period must not be negative"); }
@ImmutableValidator private void validate() { ArgChecker.isFalse(periodToStart.isNegative(), "Period to start must not be negative"); }
@ImmutableValidator private void validate() { ArgChecker.isFalse(lag.isZero() || lag.isNegative(), "Lag must be positive"); }
@ImmutableValidator private void validate() { if (getPayLeg().isPresent()) { ArgChecker.isFalse( payLeg.getPayReceive().equals(cmsLeg.getPayReceive()), "Two legs should have different Pay/Receive flags"); } }
@ImmutableValidator private void validate() { if (getPayLeg().isPresent()) { ArgChecker.isFalse(payLeg.getPayReceive().equals(cmsLeg.getPayReceive()), "Two legs should have different Pay/Receive flags"); } }
@ImmutableValidator private void validate() { ArgChecker.isFalse(spreadLeg.getCurrency().equals(flatLeg.getCurrency()), "Conventions must have different currencies"); }
@ImmutableValidator private void validate() { if (payLeg != null) { ArgChecker.isFalse( payLeg.getPayReceive().equals(capFloorLeg.getPayReceive()), "Legs must have different Pay/Receive flag, but both were {}", payLeg.getPayReceive()); } }
/** * Validates that the swaption is single currency physical. * * @param swaption the swaption */ protected void validateSwaption(ResolvedSwaption swaption) { ArgChecker.isFalse(swaption.getUnderlying().isCrossCurrency(), "Underlying swap must be single currency"); ArgChecker.isTrue(swaption.getSwaptionSettlement().getSettlementType().equals(SettlementType.PHYSICAL), "Swaption must be physical settlement"); }
private void validate(ResolvedSwaption swaption, RatesProvider ratesProvider, HullWhiteOneFactorPiecewiseConstantParametersProvider hwProvider) { ArgChecker.isTrue(hwProvider.getValuationDateTime().toLocalDate().equals(ratesProvider.getValuationDate()), "Hull-White model data and rate data should be for the same date"); ArgChecker.isFalse(swaption.getUnderlying().isCrossCurrency(), "underlying swap should be single currency"); ArgChecker.isTrue(swaption.getSwaptionSettlement().getSettlementType().equals(SettlementType.PHYSICAL), "swaption should be physical settlement"); }
@ImmutableConstructor private ResolvedIborCapFloor(ResolvedIborCapFloorLeg capFloorLeg, ResolvedSwapLeg payLeg) { JodaBeanUtils.notNull(capFloorLeg, "capFloorLeg"); if (payLeg != null) { ArgChecker.isFalse( payLeg.getPayReceive().equals(capFloorLeg.getPayReceive()), "Legs must have different Pay/Receive flag, but both were {}", payLeg.getPayReceive()); } this.capFloorLeg = capFloorLeg; this.payLeg = payLeg; this.currencies = buildCurrencies(capFloorLeg, payLeg); this.indices = buildIndices(capFloorLeg, payLeg); }
/** * Validates that the swaption is single currency cash par-yield. * * @param swaption the swaption */ protected void validateSwaption(ResolvedSwaption swaption) { ArgChecker.isFalse(swaption.getUnderlying().isCrossCurrency(), "Underlying swap must be single currency"); ArgChecker.isTrue(swaption.getSwaptionSettlement().getSettlementType().equals(SettlementType.CASH), "Swaption must be cash settlement"); CashSwaptionSettlement cashSettle = (CashSwaptionSettlement) swaption.getSwaptionSettlement(); ArgChecker.isTrue(cashSettle.getMethod().equals(CashSwaptionSettlementMethod.PAR_YIELD), "Cash settlement method must be par yield"); }