Package de.espirit.common.tools
Class Strings
java.lang.Object
de.espirit.common.tools.Strings
Generic utility to provide string related operations.
- Since:
- 5.2.21
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
implode
(@NotNull Collection<?> objects, @NotNull String delimiter) Generates a string which contains all string values of the specified collection, separated by the given delimiter.static boolean
Checks whether or not the specified string is empty.static boolean
Checks whether or not the specified string is not empty.static @NotNull String
Returns the specified string, or an empty string if the specified string isnull
.
-
Constructor Details
-
Strings
public Strings()
-
-
Method Details
-
notNull
Returns the specified string, or an empty string if the specified string isnull
.- Parameters:
string
- the string which could be null- Returns:
- the specified or empty string
- Since:
- 5.2.21
-
isEmpty
Checks whether or not the specified string is empty.- Parameters:
string
- the string to be checked for emptiness- Returns:
- is empty or not?
- Since:
- 5.2.21
-
notEmpty
Checks whether or not the specified string is not empty.- Parameters:
string
- the string to be checked for emptiness- Returns:
- is empty or not?
- Since:
- 5.2.190400
-
implode
public static String implode(@NotNull @NotNull Collection<?> objects, @NotNull @NotNull String delimiter) Generates a string which contains all string values of the specified collection, separated by the given delimiter.- Parameters:
objects
- the objects to get an imploded string representation from.delimiter
- the delimiter to use for string creation.- Returns:
- the imploded string representation.
- Since:
- 5.2.21
-