Example usage for org.apache.commons.lang Validate notNull

List of usage examples for org.apache.commons.lang Validate notNull

Introduction

In this page you can find the example usage for org.apache.commons.lang Validate notNull.

Prototype

public static void notNull(Object object) 

Source Link

Document

Validate an argument, throwing IllegalArgumentException if the argument is null.

 Validate.notNull(myObject); 

The message in the exception is 'The validated object is null'.

Usage

From source file:com.useekm.fulltext.AbstractBinary.java

protected AbstractBinary(FulltextSearch lhs, FulltextSearch rhs) {
    Validate.notNull(lhs);
    Validate.notNull(rhs);
    this.lhs = lhs;
    this.rhs = rhs;
}

From source file:com.useekm.types.GeoWkt.java

public GeoWkt(Geometry geometry) {
    super(new WKTWriter().write(geometry));
    Validate.notNull(geometry);
}

From source file:com.googlecode.commonspringaspects.aspects.ForkingAspect.java

public ForkingAspect(TaskExecutor taskExecutor) {
    Validate.notNull(taskExecutor);
    this.taskExecutor = taskExecutor;
}

From source file:hr.fer.spocc.grammar.Terminal.java

public Terminal(T value) {
    Validate.notNull(value);
    this.value = value;
}

From source file:ar.com.zauber.commons.web.uri.model.AssetModel.java

/** Creates the AssetModel. */
public AssetModel(final String key) {
    Validate.notNull(key);
    this.key = key;
}

From source file:com.opengamma.analytics.math.rootfinding.newton.ShermanMorrisonMatrixUpdateFunction.java

@Override
public DoubleMatrix2D getUpdatedMatrix(final Function1D<DoubleMatrix1D, DoubleMatrix2D> g, DoubleMatrix1D x,
        final DoubleMatrix1D deltaX, final DoubleMatrix1D deltaY, final DoubleMatrix2D matrix) {
    Validate.notNull(deltaX);
    Validate.notNull(deltaY);//from  w  w w. j a  v  a2s.  c o  m
    Validate.notNull(matrix);
    DoubleMatrix1D v1 = (DoubleMatrix1D) _algebra.multiply(deltaX, matrix);
    final double length = _algebra.getInnerProduct(v1, deltaY);
    if (length == 0) {
        return matrix;
    }
    v1 = (DoubleMatrix1D) _algebra.scale(v1, 1. / length);
    final DoubleMatrix1D v2 = (DoubleMatrix1D) _algebra.subtract(deltaX, _algebra.multiply(matrix, deltaY));
    final DoubleMatrix2D m = _algebra.getOuterProduct(v2, v1);
    return (DoubleMatrix2D) _algebra.add(matrix, m);
}

From source file:com.opengamma.analytics.financial.interestrate.ContinuousInterestRate.java

@Override
public InterestRate fromPeriodic(final PeriodicInterestRate periodic) {
    Validate.notNull(periodic);
    final int m = periodic.getCompoundingPeriodsPerYear();
    return new ContinuousInterestRate(m * Math.log(1 + periodic.getRate() / m));
}

From source file:co.marcin.novaguilds.impl.util.NonNullArrayList.java

@Override
public boolean add(E e) {
    Validate.notNull(e);
    return super.add(e);
}

From source file:com.opengamma.analytics.math.linearalgebra.CholeskyDecompositionCommons.java

/**
 * {@inheritDoc}/*  w  ww  .  j ava  2s .  c  o  m*/
 */
@Override
public CholeskyDecompositionResult evaluate(final DoubleMatrix2D x) {
    Validate.notNull(x);
    final RealMatrix temp = CommonsMathWrapper.wrap(x);
    CholeskyDecomposition cholesky;
    try {
        cholesky = new CholeskyDecompositionImpl(temp);
    } catch (Exception e) {
        throw new MathException(e.toString());
    }
    return new CholeskyDecompositionCommonsResult(cholesky);
}

From source file:com.opengamma.maths.lowlevelapi.functions.utilities.Sort.java

/**
 * Sorts values statelessly in ascending order
 * @param v1 the values to sort (a native backed array)
 * @return tmp the sorted values//from  w  w w . ja va  2s .c o  m
 */
public static float[] stateless(float[] v1) {
    Validate.notNull(v1);
    float[] tmp = Arrays.copyOf(v1, v1.length);
    Arrays.sort(tmp);
    return tmp;
}