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 void
blankCheck(String o, String param)
static String
blankChecked(String o, String param)
ThrowsIllegalArgumentException
if the parametero
isnull
or blank, otherwise returns the value of theo
parameter.static void
nullCheck(Object o, String param)
static <T> T
nullChecked(T o, String param)
ThrowsNullPointerException
if the parametero
isnull
, otherwise returns the value of theo
parameter.
-
-
-
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
- ifo
isnull
and constructs a message with the name of the parameter.
-
nullChecked
public static <T> T nullChecked(T o, String param)
ThrowsNullPointerException
if the parametero
isnull
, otherwise returns the value of theo
parameter.- 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
o
parameter. - Throws:
NullPointerException
- ifo
isnull
and 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)
ThrowsIllegalArgumentException
if the parametero
isnull
or blank, otherwise returns the value of theo
parameter.- Parameters:
o
- value to test for blank.param
- name of the parameter to check.- Returns:
- the value of the
o
parameter. - Since:
- 1.1
-
-