Class StringUtils


  • public class StringUtils
    extends java.lang.Object
    Convenience methods for String manipulation.
    • Constructor Summary

      Constructors 
      Constructor Description
      StringUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isBlank​(java.lang.CharSequence cs)
      Check that a String contains text.
      static boolean isNotBlank​(java.lang.CharSequence cs)
      Check that a String does not contain text.
      static java.lang.String streamToString​(java.io.InputStream inputStream, java.nio.charset.Charset charset)
      Convert an InputStream to a String.
      • Methods inherited from class java.lang.Object

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

      • StringUtils

        public StringUtils()
    • Method Detail

      • streamToString

        public static java.lang.String streamToString​(java.io.InputStream inputStream,
                                                      java.nio.charset.Charset charset)
                                               throws java.io.IOException
        Convert an InputStream to a String.
        Parameters:
        inputStream - The Input Stream to read from.
        charset - The charset of the Input Stream.
        Returns:
        The resulting String.
        Throws:
        java.io.IOException - An I/O error has occurred.
      • isNotBlank

        public static boolean isNotBlank​(java.lang.CharSequence cs)
        Check that a String does not contain text.
        Parameters:
        cs - The character sequence to check for text.
        Returns:
        True if not blank, false otherwise.
      • isBlank

        public static boolean isBlank​(java.lang.CharSequence cs)
        Check that a String contains text.
        Parameters:
        cs - The character sequence to check for text.
        Returns:
        True if blank, false otherwise.