Package org.camunda.commons.utils
Class EnsureUtil
- java.lang.Object
-
- org.camunda.commons.utils.EnsureUtil
-
public class EnsureUtil extends java.lang.Object- Author:
- Stefan Hentschel.
-
-
Constructor Summary
Constructors Constructor Description EnsureUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidensureNotNull(java.lang.String parameterName, java.lang.Object value)Ensures that the parameter is not null.static <T> TensureParamInstanceOf(java.lang.String objectName, java.lang.Object object, java.lang.Class<T> type)Ensure the object is of a given type and return the casted object
-
-
-
Method Detail
-
ensureNotNull
public static void ensureNotNull(java.lang.String parameterName, java.lang.Object value)Ensures that the parameter is not null.- Parameters:
parameterName- the parameter namevalue- the value to ensure to be not null- Throws:
java.lang.IllegalArgumentException- if the parameter value is null
-
ensureParamInstanceOf
public static <T> T ensureParamInstanceOf(java.lang.String objectName, java.lang.Object object, java.lang.Class<T> type)Ensure the object is of a given type and return the casted object- Parameters:
objectName- the name of the parameterobject- the parameter valuetype- the expected type- Returns:
- the parameter casted to the requested type
- Throws:
java.lang.IllegalArgumentException- in case object cannot be casted to type
-
-