Package org.castor.core.util
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 void
Asserts that passed object instance is not null and not empty.static void
Asserts that passed object instance is not null.static void
paramNotEmpty
(String param, String paramName) Asserts that passed parameter is not null and not empty.static void
paramNotNull
(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 anIllegalArgumentException
is 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 anIllegalArgumentException
is 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 anIllegalArgumentException
is 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 anIllegalArgumentException
is thrown.- Parameters:
obj
- the object instance to checkmsg
- the error message to use- Throws:
IllegalArgumentException
- if obj is null or empty string
-