public final class Strings
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isEmpty(java.lang.String s)
Check whether a String is empty.
|
static boolean |
notEmpty(java.lang.String s)
Check whether a String is not empty.
|
static java.lang.String |
safe(java.lang.String s)
Make sure a String is not
null. |
static java.lang.String |
safeTrim(java.lang.String s)
Make sure a String is not
null and trimmed. |
public static boolean isEmpty(@Nullable java.lang.String s)
A String is considered empty if it is either null or of length 0.
s - The String to check.true if the string is empty.public static boolean notEmpty(@Nullable java.lang.String s)
A String is considered empty if it is either null or of length 0.
s - The String to check.true if the string is not empty.public static java.lang.String safe(@Nullable java.lang.String s)
null.s - The String to secure."" if null was submitted.public static java.lang.String safeTrim(@Nullable java.lang.String s)
null and trimmed.s - The String to secure."" if null was submitted.