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 booleancontainsWhitespace(String s)Checks aStringfor whitespace.static booleanisEmpty(Object[] a)Determines if an array isnullor zero-length.static booleanisEmpty(String s)Determines if aStringisnull, or empty, or only contains whitespace.static booleanisSingleNonNull(Object... args)Checks that there is only a single single non-nullargument.static booleannullToFalse(Boolean boolVal)Returns false if the given Boolean parameter isnull.
-
-
-
Method Detail
-
containsWhitespace
public static boolean containsWhitespace(String s)
Checks aStringfor whitespace.- Parameters:
s-Stringto validate- Returns:
trueif contains whitespace andfalseotherwise
-
isEmpty
public static boolean isEmpty(String s)
Determines if aStringisnull, or empty, or only contains whitespace.- Parameters:
s-Stringto validate- Returns:
trueifnullor empty, or only contains whitespace, andfalseotherwise
-
isEmpty
public static boolean isEmpty(Object[] a)
Determines if an array isnullor zero-length.- Parameters:
a- Array to validate- Returns:
trueifnullor empty, andfalseotherwise
-
isSingleNonNull
public static boolean isSingleNonNull(Object... args)
Checks that there is only a single single non-nullargument.- Parameters:
args- Arguments- Returns:
trueif there is a single non-nullargument, andfalseotherwise
-
nullToFalse
public static boolean nullToFalse(Boolean boolVal)
Returns false if the given Boolean parameter isnull.- Parameters:
boolVal- boolean parameter to check- Returns:
falseif the parameter is null, and the parameter itself otherwise
-
-