Class StringUtils

java.lang.Object
org.wso2.carbon.utils.StringUtils

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

    • StringUtils

      public StringUtils()
  • Method Details

    • 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.