Package org.identityconnectors.common
Class Assertions
- java.lang.Object
-
- org.identityconnectors.common.Assertions
-
public final class Assertions extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidblankCheck(String o, String param)static StringblankChecked(String o, String param)ThrowsIllegalArgumentExceptionif the parameteroisnullor blank, otherwise returns the value of theoparameter.static voidnullCheck(Object o, String param)static <T> TnullChecked(T o, String param)ThrowsNullPointerExceptionif the parameteroisnull, otherwise returns the value of theoparameter.
-
-
-
Method Detail
-
nullCheck
public static void nullCheck(Object o, String param)
- Parameters:
o- check if the object isnull.param- name of the parameter to check fornull.- Throws:
NullPointerException- ifoisnulland constructs a message with the name of the parameter.
-
nullChecked
public static <T> T nullChecked(T o, String param)ThrowsNullPointerExceptionif the parameteroisnull, otherwise returns the value of theoparameter.- Type Parameters:
T- the type of the value- Parameters:
o- check if the object isnull.param- name of the parameter to check fornull.- Returns:
- the value of the
oparameter. - Throws:
NullPointerException- ifoisnulland constructs a message with the name of the parameter.- Since:
- 1.1
-
blankCheck
public static void blankCheck(String o, String param)
- Parameters:
o- value to test for blank.param- name of the parameter to check.
-
blankChecked
public static String blankChecked(String o, String param)
ThrowsIllegalArgumentExceptionif the parameteroisnullor blank, otherwise returns the value of theoparameter.- Parameters:
o- value to test for blank.param- name of the parameter to check.- Returns:
- the value of the
oparameter. - Since:
- 1.1
-
-