Package org.graylog2.shared.utilities
Class StringUtils
java.lang.Object
org.graylog2.shared.utilities.StringUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringCallsString.format(Locale, String, Object...)with the given arguments with a locale value ofLocale.ENGLISH.static StringhumanReadableByteCount(long bytes) static StringrequireNonBlank(String value) Returns the given string if it's not null and not only whitespace.static StringrequireNonBlank(String value, String message) Returns the given string if it's not null and not only whitespace.splitByComma(List<String> values) splitByComma(Set<String> values) static StringtoLowerCase(String value) CallsString.toLowerCase(Locale)on the given string with a locale value ofLocale.ENGLISH.static StringtoUpperCase(String value) CallsString.toUpperCase(Locale)on the given string with a locale value ofLocale.ENGLISH.
-
Method Details
-
f
CallsString.format(Locale, String, Object...)with the given arguments with a locale value ofLocale.ENGLISH.- Parameters:
format- the format stringargs- the format arguments- Returns:
- the formatted string
-
toUpperCase
CallsString.toUpperCase(Locale)on the given string with a locale value ofLocale.ENGLISH.- Parameters:
value- the value- Returns:
- the value in upper case
- Throws:
IllegalArgumentException- when given value is null
-
toLowerCase
CallsString.toLowerCase(Locale)on the given string with a locale value ofLocale.ENGLISH.- Parameters:
value- the value- Returns:
- the value in lower case
- Throws:
IllegalArgumentException- when given value is null
-
humanReadableByteCount
-
splitByComma
-
splitByComma
-
requireNonBlank
Returns the given string if it's not null and not only whitespace. Otherwise, throws an exception.- Parameters:
value- the string value to check- Returns:
- the value if not null or blank
- Throws:
IllegalArgumentException- when given string is null or whitespace
-
requireNonBlank
Returns the given string if it's not null and not only whitespace. Otherwise, throws an exception.- Parameters:
value- the string value to checkmessage- the exception message- Returns:
- the value if not null or blank
- Throws:
IllegalArgumentException- when given string is null or whitespace
-