Package org.forgerock.api.util
Class ValidationUtil
java.lang.Object
org.forgerock.api.util.ValidationUtil
API Descriptor model-validation utilities.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanChecks aStringfor whitespace.static booleanDetermines if an array isnullor zero-length.static booleanDetermines 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 Details
-
containsWhitespace
Checks aStringfor whitespace.- Parameters:
s-Stringto validate- Returns:
trueif contains whitespace andfalseotherwise
-
isEmpty
Determines if aStringisnull, or empty, or only contains whitespace.- Parameters:
s-Stringto validate- Returns:
trueifnullor empty, or only contains whitespace, andfalseotherwise
-
isEmpty
Determines if an array isnullor zero-length.- Parameters:
a- Array to validate- Returns:
trueifnullor empty, andfalseotherwise
-
isSingleNonNull
Checks that there is only a single single non-nullargument.- Parameters:
args- Arguments- Returns:
trueif there is a single non-nullargument, andfalseotherwise
-
nullToFalse
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
-