Class StringUtil

java.lang.Object
com.sinch.sdk.core.utils.StringUtil

public class StringUtil extends Object
Utility class for string
  • Method Details

    • isEmpty

      public static boolean isEmpty(String value)
      Check if a string is empty
      Parameters:
      value - String to be cheked
      Returns:
      true if String is null, empty or contains only spaces characters
      Since:
      1.0
    • requireNonEmpty

      public static String requireNonEmpty(String obj, String message)
      Checks that the specified object reference is not null not an empty string. This method is designed primarily for doing parameter validation in methods and constructors
      Parameters:
      obj - the object reference to check for nullity
      message - detail message to be used in the event that a IllegalArgumentException is thrown
      Returns:
      obj if not null nor empty
      Throws:
      IllegalArgumentException - if obj is null or empty