Class StringUtils
- java.lang.Object
-
- io.micrometer.core.instrument.util.StringUtils
-
public final class StringUtils extends java.lang.Object
Utilities forString
.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isBlank(java.lang.String string)
Check if the String is null or has only whitespaces.static boolean
isEmpty(java.lang.String string)
Check if the String is null or empty.static boolean
isNotBlank(java.lang.String string)
Check if the String has any non-whitespace character.static boolean
isNotEmpty(java.lang.String string)
Check if the String has any character.static java.lang.String
truncate(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:
true
if 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:
true
if 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:
true
if 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:
true
if 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
-
-