Package org.forgerock.api.util
Class ValidationUtil
- java.lang.Object
-
- org.forgerock.api.util.ValidationUtil
-
public final class ValidationUtil extends Object
API Descriptor model-validation utilities.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
containsWhitespace(String s)
Checks aString
for whitespace.static boolean
isEmpty(Object[] a)
Determines if an array isnull
or zero-length.static boolean
isEmpty(String s)
Determines if aString
isnull
, or empty, or only contains whitespace.static boolean
isSingleNonNull(Object... args)
Checks that there is only a single single non-null
argument.static boolean
nullToFalse(Boolean boolVal)
Returns false if the given Boolean parameter isnull
.
-
-
-
Method Detail
-
containsWhitespace
public static boolean containsWhitespace(String s)
Checks aString
for whitespace.- Parameters:
s
-String
to validate- Returns:
true
if contains whitespace andfalse
otherwise
-
isEmpty
public static boolean isEmpty(String s)
Determines if aString
isnull
, or empty, or only contains whitespace.- Parameters:
s
-String
to validate- Returns:
true
ifnull
or empty, or only contains whitespace, andfalse
otherwise
-
isEmpty
public static boolean isEmpty(Object[] a)
Determines if an array isnull
or zero-length.- Parameters:
a
- Array to validate- Returns:
true
ifnull
or empty, andfalse
otherwise
-
isSingleNonNull
public static boolean isSingleNonNull(Object... args)
Checks that there is only a single single non-null
argument.- Parameters:
args
- Arguments- Returns:
true
if there is a single non-null
argument, andfalse
otherwise
-
nullToFalse
public static boolean nullToFalse(Boolean boolVal)
Returns false if the given Boolean parameter isnull
.- Parameters:
boolVal
- boolean parameter to check- Returns:
false
if the parameter is null, and the parameter itself otherwise
-
-