List of usage examples for org.apache.commons.lang Validate notEmpty
public static void notEmpty(String string, String message)
Validate an argument, throwing IllegalArgumentException
if the argument String is empty (null
or zero length).
Validate.notEmpty(myString, "The string must not be empty");
From source file:bigbluej.DeleteRecordingsCommand.java
public DeleteRecordingsCommand(String recordID) { Validate.notEmpty(recordID, "recordID"); this.recordID = recordID; }
From source file:bigbluej.IsMeetingRunningCommand.java
public IsMeetingRunningCommand(String meetingID) { Validate.notEmpty(meetingID, "meetingID"); this.meetingID = meetingID; }
From source file:com.opengamma.analytics.math.integration.Integrator1D.java
/** * {@inheritDoc}/*from w ww . j av a 2 s .c om*/ */ @Override public T integrate(final Function1D<U, T> f, final U[] lower, final U[] upper) { Validate.notNull(f, "function was null"); Validate.notNull(lower, "lower bound array was null"); Validate.notNull(upper, "upper bound array was null"); Validate.notEmpty(lower, "lower bound array was empty"); Validate.notEmpty(upper, "upper bound array was empty"); Validate.notNull(lower[0], "lower bound was null"); Validate.notNull(upper[0], "upper bound was null"); if (lower.length > 1) { s_logger.info("Lower bound array had more than one element; only using the first"); } if (upper.length > 1) { s_logger.info("Upper bound array had more than one element; only using the first"); } return integrate(f, lower[0], upper[0]); }
From source file:bigbluej.EndCommand.java
public EndCommand(String meetingID, String password) { Validate.notEmpty(meetingID, "meetingID"); Validate.notEmpty(password, "password"); this.meetingID = meetingID; this.password = password; }
From source file:bigbluej.GetMeetingInfoCommand.java
public GetMeetingInfoCommand(String meetingID, String password) { Validate.notEmpty(meetingID, "meetingID"); Validate.notEmpty(password, "password"); this.meetingID = meetingID; this.password = password; }
From source file:bigbluej.PublishRecordingsCommand.java
public PublishRecordingsCommand(String recordID, boolean publish) { Validate.notEmpty(recordID, "recordID"); this.recordID = recordID; this.publish = publish; }
From source file:com.opengamma.analytics.math.curve.SubtractCurveSpreadFunction.java
/** * @param curves An array of curves, not null or empty * @return A function that will find the value of each curve at the given input <i>x</i> and subtract each in turn *//*from www .j av a 2 s. com*/ @Override public Function<Double, Double> evaluate(final Curve<Double, Double>... curves) { Validate.notNull(curves, "x"); Validate.notEmpty(curves, "curves"); return new Function<Double, Double>() { @Override public Double evaluate(final Double... x) { Validate.notNull(x, "x"); Validate.notEmpty(x, "x"); final double x0 = x[0]; double y = curves[0].getYValue(x0); for (int i = 1; i < curves.length; i++) { y -= curves[i].getYValue(x0); } return y; } }; }
From source file:com.opengamma.analytics.math.curve.AddCurveSpreadFunction.java
/** * @param curves An array of curves, not null or empty * @return A function that will find the value of each curve at the given input <i>x</i> and return the sum of these values *//*from w w w. ja v a2 s . co m*/ @Override public Function<Double, Double> evaluate(final Curve<Double, Double>... curves) { Validate.notNull(curves, "x"); Validate.notEmpty(curves, "curves"); return new Function<Double, Double>() { @Override public Double evaluate(final Double... x) { Validate.notNull(x, "x"); Validate.notEmpty(x, "x"); final double x0 = x[0]; double y = curves[0].getYValue(x0); for (int i = 1; i < curves.length; i++) { y += curves[i].getYValue(x0); } return y; } }; }
From source file:com.opengamma.analytics.financial.pnl.SensitivityAndReturnDataBundle.java
public SensitivityAndReturnDataBundle(final Sensitivity<?> sensitivity, final double value, final Map<UnderlyingType, DoubleTimeSeries<?>> underlyingReturnTS) { Validate.notNull(sensitivity, "sensitivity"); Validate.notNull(underlyingReturnTS, "underlying returns"); Validate.notEmpty(underlyingReturnTS, "underlying returns"); Validate.noNullElements(underlyingReturnTS.keySet(), "underlying return key set"); Validate.noNullElements(underlyingReturnTS.values(), "underlying return values"); _underlyings = sensitivity.getUnderlyingTypes(); Validate.isTrue(_underlyings.size() == underlyingReturnTS.size()); Validate.isTrue(_underlyings.containsAll(underlyingReturnTS.keySet())); _sensitivity = sensitivity;/* www . j av a 2s . c o m*/ _value = value; _underlyingReturnTS = underlyingReturnTS; }
From source file:bigbluej.SetConfigXMLCommand.java
public SetConfigXMLCommand(String meetingID, Config config) { Validate.notEmpty(meetingID, "meetingID"); Validate.notNull(config, "config"); this.meetingID = meetingID; this.config = config; }