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 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.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:
true
if the String is null or has only whitespaces
-
isNotBlank
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
Check if the String is null or empty.- Parameters:
string
- String to check- Returns:
true
if the String is null or empty
-
isNotEmpty
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
-