Package io.micrometer.common.util
Class StringUtils
java.lang.Object
io.micrometer.common.util.StringUtils
Utilities for
String.-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanCheck if the String is null or has only whitespaces.static booleanCheck if the String is null or empty.static booleanisNotBlank(String string) Check if the String has any non-whitespace character.static booleanisNotEmpty(String string) Check if the String has any character.static StringTruncate the String to the max length.static StringTruncate the String to the max length and append string to indicate if truncation was applied
-
Method Details
-
isBlank
Check if the String is null or has only whitespaces. Modified fromorg.apache.commons.lang.StringUtils#isBlank(String).- Parameters:
string- String to check- Returns:
trueif the String is null or has only whitespaces
-
isNotBlank
Check if the String has any non-whitespace character.- Parameters:
string- String to check- Returns:
trueif the String has any non-whitespace character
-
isEmpty
Check if the String is null or empty.- Parameters:
string- String to check- Returns:
trueif the String is null or empty
-
isNotEmpty
Check if the String has any character.- Parameters:
string- String to check- Returns:
trueif the String has any character- Since:
- 1.1.0
-
truncate
Truncate the String to the max length.- Parameters:
string- String to truncatemaxLength- max length- Returns:
- truncated String
-
truncate
Truncate the String to the max length and append string to indicate if truncation was applied- Parameters:
string- String to truncatemaxLength- max length, which includes the length required fortruncationIndicatortruncationIndicator- A string that is appended ifstringis truncated- Returns:
- truncated String
-