public class Assert extends Object
public static <T> T assertNotNull(T value,
String parameterName)
value if it is not null. Otherwise a
IllegalArgumentException will be thrown, the given
parameterName is included in the Message. Eg. null will be passed, the message of the exception is "Parameter >value< must not be null !"
public void myMethod(Integer value){
assertNotNull(value,"value");
...
}
T - Type of the valuevalue - the value to checkparameterName - name of the parameter to be included in a possible
IllegalArgumentExceptionvalueIllegalArgumentException - if value==nullCopyright © 2009–2013 Apache MINA Project. All rights reserved.