Package org.identityconnectors.common
Class Assertions
- java.lang.Object
-
- org.identityconnectors.common.Assertions
-
public final class Assertions extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
blankCheck(java.lang.String o, java.lang.String param)
ThrowsIllegalArgumentException
if the parametero
isnull
or blank.static java.lang.String
blankChecked(java.lang.String o, java.lang.String param)
ThrowsIllegalArgumentException
if the parametero
isnull
or blank, otherwise returns the value of theo
parameter.static void
nullCheck(java.lang.Object o, java.lang.String param)
ThrowsNullPointerException
if the parametero
isnull
.static <T> T
nullChecked(T o, java.lang.String param)
ThrowsNullPointerException
if the parametero
isnull
, otherwise returns the value of theo
parameter.
-
-
-
Method Detail
-
nullCheck
public static void nullCheck(java.lang.Object o, java.lang.String param)
ThrowsNullPointerException
if the parametero
isnull
.- Parameters:
o
- check if the object isnull
.param
- name of the parameter to check fornull
.- Throws:
java.lang.NullPointerException
- ifo
isnull
and constructs a message with the name of the parameter.
-
nullChecked
public static <T> T nullChecked(T o, java.lang.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:
java.lang.NullPointerException
- ifo
isnull
and constructs a message with the name of the parameter.- Since:
- 1.1
-
blankCheck
public static void blankCheck(java.lang.String o, java.lang.String param)
ThrowsIllegalArgumentException
if the parametero
isnull
or blank.- Parameters:
o
- value to test for blank.param
- name of the parameter to check.
-
blankChecked
public static java.lang.String blankChecked(java.lang.String o, java.lang.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
-
-