Package org.faktorips.runtime.internal
Class IpsStringUtils
java.lang.Object
org.faktorips.runtime.internal.IpsStringUtils
A collection of utility methods for Strings. We don't use a class library like apache-commons
here to minimize the dependencies for the generated code.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanequalsNullAsEmpty(String s1, String s2) Compares two strings, treatingnullasEMPTY.static booleanReturnstrueifsis eithernull, the empty string or a string that only contains whitespace, otherwisefalse.static booleanReturnstrueifsis eithernullor the empty string, otherwisefalse.static booleanisNotBlank(String s) Returnstrueifsis neithernull, the empty string nor a string that only contains whitespace, otherwisefalse.static booleanisNotEmpty(String s) Returnstrueifsis neithernullnor the empty string, otherwisefalse.static Stringstatic StringJoins the elements of the providedIterableinto a single String containing the provided elements with the given separator.static <T> Stringstatic <T> Stringstatic StringJoins the elements of the provided array into a single String containing the provided elements with the default separator ", ".static StringJoins the elements of the provided array into a single String containing the provided elements with the given separator.static Stringjoin(Collection<?> collection, String separator) Joins the elements of the providedCollectioninto a single String containing the provided elements with the given separator.static StringtoLowerFirstChar(String string) static booleantrimEquals(String s1, String s2) Trims the parameters, if the are notnulland checks for equality usingObjects.equals(Object, Object).
-
Field Details
-
EMPTY
- See Also:
-
-
Method Details
-
isEmpty
Returnstrueifsis eithernullor the empty string, otherwisefalse. -
isNotEmpty
Returnstrueifsis neithernullnor the empty string, otherwisefalse. -
isBlank
Returnstrueifsis eithernull, the empty string or a string that only contains whitespace, otherwisefalse. -
isNotBlank
Returnstrueifsis neithernull, the empty string nor a string that only contains whitespace, otherwisefalse. -
trimEquals
Trims the parameters, if the are notnulland checks for equality usingObjects.equals(Object, Object).- Parameters:
s1- a strings2- another string to be compared with a for equality- Returns:
trueif the arguments are equal to each other andfalseotherwise
-
equalsNullAsEmpty
Compares two strings, treatingnullasEMPTY.- Parameters:
s1- a strings2- another string- Returns:
- whether both strings are equal
-
join
Joins the elements of the providedCollectioninto a single String containing the provided elements with the given separator. No delimiter is added before or after the list.- Parameters:
collection- the Collection of values to join together, may benullseparator- the separator to use,nulltreated as ""- Returns:
- the joined String, empty if the collection is
null
-
join
Joins the elements of the providedIterableinto a single String containing the provided elements with the given separator. No delimiter is added before or after the list.- Parameters:
iterable- the Collection of values to join together, may benullseparator- the separator to use,nulltreated as ""- Returns:
- the joined String, empty if the collection is
null
-
join
Joins the elements of the providedIterableinto a single String containing the provided elements with the default separator ", ". No delimiter is added before or after the list.- Parameters:
iterable- the Collection of values to join together, may benull- Returns:
- the joined String, empty if the collection is
null
-
join
Joins the elements of the provided array into a single String containing the provided elements with the default separator ", ". No delimiter is added before or after the list.- Parameters:
objectArray- the array of values to join together, may benull- Returns:
- the joined String, empty if the collection is
null
-
join
Joins the elements of the provided array into a single String containing the provided elements with the given separator. No delimiter is added before or after the list.- Parameters:
objectArray- the array of values to join together, may benullseparator- the separator to use,nulltreated as ""- Returns:
- the joined String, empty if the collection is
null
-
join
-
join
public static <T> String join(Iterable<T> iterable, Function<? super T, String> toString, String separator) -
toLowerFirstChar
-