Package de.carne.gradle.plugin.java.util
Class Strings
- java.lang.Object
-
- de.carne.gradle.plugin.java.util.Strings
-
public final class Strings extends java.lang.ObjectUtility class providing String related functions.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisEmpty(@Nullable java.lang.String s)Checks whether a String is empty.static booleannotEmpty(@Nullable java.lang.String s)Checks whether a String is not empty.static java.lang.Stringsafe(@Nullable java.lang.String s)Makes sure a String is notnull.
-
-
-
Method Detail
-
isEmpty
public static boolean isEmpty(@Nullable java.lang.String s)
Checks whether a String is empty.A String is considered empty if it is either
nullor of length0.- Parameters:
s- the String to check.- Returns:
trueif the string is empty.
-
notEmpty
public static boolean notEmpty(@Nullable java.lang.String s)
Checks whether a String is not empty.A String is considered empty if it is either
nullor of length0.- Parameters:
s- the String to check.- Returns:
trueif the string is not empty.
-
safe
public static java.lang.String safe(@Nullable java.lang.String s)
Makes sure a String is notnull.- Parameters:
s- the String to check.- Returns:
- the submitted String or
""ifnullwas submitted.
-
-