Package com.atlassian.oai.validator.util
Class StringUtils
java.lang.Object
com.atlassian.oai.validator.util.StringUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringaddOpeningAndTrailingNewlines(String string, boolean doNotAddIfAlreadyThere) Adds "\r\n" to the beginning and to the end of the string if not therestatic StringindentString(String stringToIndent, String indentStr) Inserts indentStr before every linestatic StringrequireNonEmpty(String value, String msg) Require that the given value is non-empty.
-
Method Details
-
requireNonEmpty
Require that the given value is non-empty.- Parameters:
value- The value to checkmsg- The message to emit if validation fails- Returns:
- the input value
- Throws:
IllegalArgumentException- If the input value is null or empty
-
addOpeningAndTrailingNewlines
Adds "\r\n" to the beginning and to the end of the string if not there- Parameters:
string- - string to wrapdoNotAddIfAlreadyThere- - when true, it won't append/prepend string with the new lines if they are already there
-
indentString
Inserts indentStr before every line- Parameters:
stringToIndent-indentStr-- Returns:
-