Class StringUtils


  • public class StringUtils
    extends Object
    This class contains utility methods for Strings.
    Since:
    1.0.0
    • Constructor Detail

      • StringUtils

        public StringUtils()
    • Method Detail

      • isNullOrEmpty

        public static boolean isNullOrEmpty​(String str)
        Check whether the given String is null or empty.
        Parameters:
        str - input string
        Returns:
        true if the given String is null or empty.
      • isNullOrEmptyAfterTrim

        public static boolean isNullOrEmptyAfterTrim​(String str)
        Check whether the given String is null of empty after the trim operation.
        Parameters:
        str - input string.
        Returns:
        'true' if the given String is null or empty after trim.
      • getNonEmptyStringAfterTrim

        public static Optional<String> getNonEmptyStringAfterTrim​(String str)
        Returns non-empty Optional<String>, if the given String is non-empty after applying trim() operation.
        Parameters:
        str - input String.
        Returns:
        Optional<String>, if the given String is non-empty after applying trim() operation. If not an empty Optional<String> will be returned.