Class StringUtils
- java.lang.Object
-
- io.micrometer.core.instrument.util.StringUtils
-
public final class StringUtils extends java.lang.ObjectUtilities forString.
-
-
Method Summary
All Methods Static Methods Concrete Methods 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.
-
-
-
Method Detail
-
isBlank
public static boolean isBlank(@Nullable java.lang.String string)
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
public static boolean isNotBlank(@Nullable java.lang.String string)
Check if the String has any non-whitespace character.- Parameters:
string- String to check- Returns:
trueif the String has any non-whitespace character
-
isEmpty
public static boolean isEmpty(@Nullable java.lang.String string)
Check if the String is null or empty.- Parameters:
string- String to check- Returns:
trueif the String is null or empty
-
isNotEmpty
public static boolean isNotEmpty(@Nullable java.lang.String string)
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
-
-