Class StringUtils
java.lang.Object
io.micrometer.core.instrument.util.StringUtils
public final class StringUtils
extends java.lang.Object
Utilities for
String.-
Method Summary
Modifier and Type Method Description static booleanisBlank(java.lang.String string)Check if the String is null or has only whitespaces.static booleanisEmpty(java.lang.String string)Check if the String is null or empty.static booleanisNotBlank(java.lang.String string)Check if the String has any non-whitespace character.static booleanisNotEmpty(java.lang.String string)Check if the String has any character.static java.lang.Stringtruncate(java.lang.String string, int maxLength)Truncate the String to the max length.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
isBlank
Check if the String is null or has only whitespaces. Modified fromStringUtils.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
public static java.lang.String truncate(java.lang.String string, int maxLength)Truncate the String to the max length.- Parameters:
string- String to truncatemaxLength- max length- Returns:
- truncated String
-