Class Assert
java.lang.Object
org.castor.core.util.Assert
A helper class that defines a method used for validating the input arguments.
- Since:
- 1.3.3
- Version:
- 1.3.3
- Author:
- Jakub Narloch
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidAsserts that passed object instance is not null and not empty.static voidAsserts that passed object instance is not null.static voidparamNotEmpty(String param, String paramName) Asserts that passed parameter is not null and not empty.static voidparamNotNull(Object param, String paramName) Asserts that passed parameter is not null.
-
Method Details
-
paramNotNull
Asserts that passed parameter is not null. In case it is, then anIllegalArgumentExceptionis thrown.- Parameters:
param- the parameter to checkparamName- the parameter name- Throws:
IllegalArgumentException- if param is null
-
paramNotEmpty
Asserts that passed parameter is not null and not empty. In case it is, then anIllegalArgumentExceptionis thrown.- Parameters:
param- the parameter to checkparamName- the parameter name- Throws:
IllegalArgumentException- if param is null or empty string
-
notNull
Asserts that passed object instance is not null. In case it is, then anIllegalArgumentExceptionis thrown.- Parameters:
obj- the object instance to checkmsg- the error message to use- Throws:
IllegalArgumentException- if obj is null
-
notEmpty
Asserts that passed object instance is not null and not empty. In case it is, then anIllegalArgumentExceptionis thrown.- Parameters:
obj- the object instance to checkmsg- the error message to use- Throws:
IllegalArgumentException- if obj is null or empty string
-