Class StringUtil


  • public class StringUtil
    extends java.lang.Object
    Implements utility methods for strings.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getOrEmpty​(java.lang.String str)
      Gets a string or an empty string if the given string is null.
      static boolean isNotEmpty​(java.lang.String str)
      Tells if a string is not empty.
      • Methods inherited from class java.lang.Object

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

      • isNotEmpty

        public static boolean isNotEmpty​(java.lang.String str)
        Tells if a string is not empty. Returns false when the object is null.
        Parameters:
        str - the string to check
        Returns:
        a boolean
      • getOrEmpty

        public static java.lang.String getOrEmpty​(java.lang.String str)
        Gets a string or an empty string if the given string is null.
        Parameters:
        str - the string to get
        Returns:
        a string