List of usage examples for org.apache.commons.lang Validate notNull
public static void notNull(Object object)
Validate an argument, throwing IllegalArgumentException
if the argument is null
.
Validate.notNull(myObject);
The message in the exception is 'The validated object is null'.
From source file:com.useekm.types.GeoWkb.java
public GeoWkb(Geometry geometry) { super(new String(Base64.encodeBase64(new WKBWriter().write(geometry)))); Validate.notNull(geometry); }
From source file:com.opengamma.analytics.financial.interestrate.payments.derivative.PaymentFixed.java
/** * Fixed payment constructor./* ww w. j a v a2s .c om*/ * @param currency The payment currency. * @param paymentTime Time (in years) up to the payment. * @param paymentAmount The amount paid. * @param fundingCurve Name of the funding curve. */ public PaymentFixed(final Currency currency, final double paymentTime, final double paymentAmount, final String fundingCurve) { super(currency, paymentTime, fundingCurve); Validate.notNull(fundingCurve); _amount = paymentAmount; }
From source file:com.edmunds.etm.loadbalancer.api.PoolMember.java
public PoolMember(HostAddress hostAddress) { Validate.notNull(hostAddress); this.hostAddress = hostAddress; }
From source file:com.opengamma.financial.convention.daycount.ActualThreeSixtyFiveLong.java
@Override public double getAccruedInterest(final ZonedDateTime previousCouponDate, final ZonedDateTime date, final ZonedDateTime nextCouponDate, final double coupon, final double paymentsPerYear) { Validate.notNull(previousCouponDate); Validate.notNull(date);/*from w w w .ja v a 2 s . c o m*/ Validate.notNull(nextCouponDate); return getAccruedInterest(previousCouponDate.toLocalDate(), date.toLocalDate(), nextCouponDate.toLocalDate(), coupon, paymentsPerYear); }
From source file:com.useekm.types.GeoWkbGz.java
public GeoWkbGz(Geometry geometry) { super(new String(Base64.encodeBase64(gzip(new WKBWriter().write(geometry))))); Validate.notNull(geometry); }
From source file:com.opengamma.analytics.math.matrix.DoubleMatrix1D.java
/** * @param data The data, not null/*from ww w. ja v a2s . com*/ */ public DoubleMatrix1D(final double... data) { Validate.notNull(data); _elements = data.length; _data = Arrays.copyOf(data, _elements); }
From source file:ar.com.zauber.commons.dao.predicate.IgnoreCaseEqualsPredicate.java
/** Creates the EqualsPredicate. */ public IgnoreCaseEqualsPredicate(final String target) { Validate.notNull(target); this.target = target; }
From source file:com.opengamma.analytics.financial.model.option.pricing.analytic.LogOptionModel.java
@Override public Function1D<StandardOptionDataBundle, Double> getPricingFunction(final LogOptionDefinition definition) { Validate.notNull(definition); final Function1D<StandardOptionDataBundle, Double> pricingFunction = new Function1D<StandardOptionDataBundle, Double>() { @SuppressWarnings("synthetic-access") @Override// w w w.j a v a2 s .c om public Double evaluate(final StandardOptionDataBundle data) { Validate.notNull(data); final double s = data.getSpot(); final double k = definition.getStrike(); final double t = definition.getTimeToExpiry(data.getDate()); final double b = data.getCostOfCarry(); final double r = data.getInterestRate(t); final double sigma = data.getVolatility(t, k); final double df = Math.exp(-r * t); final double sigmaT = sigma * Math.sqrt(t); final double x = (Math.log(s / k) + t * (b - sigma * sigma * 0.5)) / sigmaT; return df * sigmaT * (_normalProbabilityDistribution.getPDF(x) + x * _normalProbabilityDistribution.getCDF(x)); } }; return pricingFunction; }
From source file:com.vmware.identity.sts.util.MessageExtractionUtil.java
/** * Parse the servlet request to get the user name * @param req/*from ww w . ja v a2 s .co m*/ * @return */ public static String extractUsernameFromSevletRequest(ServletRequest req) { Validate.notNull(req); SecurityHeaderType secHdr = (SecurityHeaderType) req.getAttribute(WsConstants.SECURITY_HEADER_KEY); assert secHdr != null; return extractUsernameFromSecurityHeader(secHdr); }
From source file:com.opengamma.analytics.math.interpolation.GridInterpolator2D.java
public GridInterpolator2D(final Interpolator1D xInterpolator, final Interpolator1D yInterpolator) { Validate.notNull(xInterpolator); Validate.notNull(yInterpolator);//w w w . ja v a2 s . com _xInterpolator = xInterpolator; _yInterpolator = yInterpolator; _comparator = FirstThenSecondPairComparator.INSTANCE_DOUBLES; }