Class StringUtils


  • public final class StringUtils
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static boolean isBlank​(java.lang.String input)
      Checks if string input is blank or null.
      static boolean isEmpty​(java.lang.String input)
      Checks if string input is empty or null.
      static boolean isNotBlank​(java.lang.String string)
      Checks if string is neither null or blank.
      static boolean isNotEmpty​(java.lang.String string)
      Checks if string is neither null or empty.
      static boolean isNotNullOrBlank​(java.lang.String string)
      Deprecated, for removal: This API element is subject to removal in a future version.
      static boolean isNotNullOrEmpty​(java.lang.String string)
      Deprecated, for removal: This API element is subject to removal in a future version.
      static boolean isNullOrBlank​(java.lang.String string)
      Deprecated, for removal: This API element is subject to removal in a future version.
      static boolean isNullOrEmpty​(java.lang.String string)
      Deprecated, for removal: This API element is subject to removal in a future version.
      static java.lang.String removeMultipleWhiteSpaces​(java.lang.String input)
      Replaces multiple consecutive whitespaces with a single whitespace.
      static java.lang.String removeWhiteSpaces​(java.lang.String input)
      Remove all whitespaces.
      static java.lang.String replaceWhiteSpacesWithSpace​(java.lang.String str)
      Replaces whitespaces with space.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • removeMultipleWhiteSpaces

        public static java.lang.String removeMultipleWhiteSpaces​(java.lang.String input)
        Replaces multiple consecutive whitespaces with a single whitespace.
        Parameters:
        input - A string with or without multiple consecutive whitespaces.
        Returns:
        A string without multiple consecutive whitespaces where are whitespaces have been replaced by a space.
      • removeWhiteSpaces

        public static java.lang.String removeWhiteSpaces​(java.lang.String input)
        Remove all whitespaces.
        Parameters:
        input - A string with or without multiple consecutive whitespaces.
        Returns:
        a string without spaces.
      • isBlank

        public static boolean isBlank​(java.lang.String input)
        Checks if string input is blank or null.
        Parameters:
        input - input string
        Returns:
        true if blank.
      • isEmpty

        public static boolean isEmpty​(java.lang.String input)
        Checks if string input is empty or null.
        Parameters:
        input - input string
        Returns:
        true if empty.
      • replaceWhiteSpacesWithSpace

        public static java.lang.String replaceWhiteSpacesWithSpace​(java.lang.String str)
        Replaces whitespaces with space.
        Parameters:
        str - input string.
        Returns:
        string with all whitespaces replaced by spaces
      • isNotNullOrEmpty

        @Deprecated(forRemoval=true)
        public static boolean isNotNullOrEmpty​(java.lang.String string)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Checks if string is neither null or empty.
        Parameters:
        string - string to check
        Returns:
        true if string is neither null or empty.
        See Also:
        isNotEmpty(String)
      • isNotEmpty

        public static boolean isNotEmpty​(java.lang.String string)
        Checks if string is neither null or empty.
        Parameters:
        string - string to check
        Returns:
        true if string is neither null or empty.
      • isNotNullOrBlank

        @Deprecated(forRemoval=true)
        public static boolean isNotNullOrBlank​(java.lang.String string)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Checks if string is neither null or blank.
        Parameters:
        string - string to check
        Returns:
        true if string is neither null or empty.
        See Also:
        isNotBlank(String)
      • isNotBlank

        public static boolean isNotBlank​(java.lang.String string)
        Checks if string is neither null or blank.
        Parameters:
        string - string to check
        Returns:
        true if string is neither null or empty.
      • isNullOrEmpty

        @Deprecated(forRemoval=true)
        public static boolean isNullOrEmpty​(java.lang.String string)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Checks if string is null or empty.
        Parameters:
        string - string to check
        Returns:
        true if string is null or empty.
        See Also:
        isEmpty(String)
      • isNullOrBlank

        @Deprecated(forRemoval=true)
        public static boolean isNullOrBlank​(java.lang.String string)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Checks if string is null or blank.
        Parameters:
        string - string to check
        Returns:
        true if string is null or empty.
        See Also:
        isBlank(String)