Class ValidationUtil


  • public final class ValidationUtil
    extends Object
    API Descriptor model-validation utilities.
    • Method Detail

      • containsWhitespace

        public static boolean containsWhitespace​(String s)
        Checks a String for whitespace.
        Parameters:
        s - String to validate
        Returns:
        true if contains whitespace and false otherwise
      • isEmpty

        public static boolean isEmpty​(String s)
        Determines if a String is null, or empty, or only contains whitespace.
        Parameters:
        s - String to validate
        Returns:
        true if null or empty, or only contains whitespace, and false otherwise
      • isEmpty

        public static boolean isEmpty​(Object[] a)
        Determines if an array is null or zero-length.
        Parameters:
        a - Array to validate
        Returns:
        true if null or empty, and false 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, and false otherwise
      • nullToFalse

        public static boolean nullToFalse​(Boolean boolVal)
        Returns false if the given Boolean parameter is null.
        Parameters:
        boolVal - boolean parameter to check
        Returns:
        false if the parameter is null, and the parameter itself otherwise