Class StringUtils

java.lang.Object
com.atlassian.oai.validator.util.StringUtils

public class StringUtils extends Object
  • Method Details

    • requireNonEmpty

      public static String requireNonEmpty(String value, String msg)
      Require that the given value is non-empty.
      Parameters:
      value - The value to check
      msg - The message to emit if validation fails
      Returns:
      the input value
      Throws:
      IllegalArgumentException - If the input value is null or empty
    • addOpeningAndTrailingNewlines

      public static String addOpeningAndTrailingNewlines(String string, boolean doNotAddIfAlreadyThere)
      Adds "\r\n" to the beginning and to the end of the string if not there
      Parameters:
      string - - string to wrap
      doNotAddIfAlreadyThere - - when true, it won't append/prepend string with the new lines if they are already there
    • indentString

      public static String indentString(String stringToIndent, String indentStr)
      Inserts indentStr before every line
      Parameters:
      stringToIndent -
      indentStr -
      Returns: