Package org.faktorips.runtime.internal
Class IpsStringUtils
- java.lang.Object
-
- org.faktorips.runtime.internal.IpsStringUtils
-
public final class IpsStringUtils extends java.lang.ObjectA 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 Modifier and Type Field Description static java.lang.StringEMPTY
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisBlank(java.lang.String s)Returnstrueifsis eithernull, the empty string or a string that only contains whitespace, otherwisefalse.static booleanisEmpty(java.lang.String s)Returnstrueifsis eithernullor the empty string, otherwisefalse.static booleanisNotBlank(java.lang.String s)Returnstrueifsis neithernull, the empty string nor a string that only contains whitespace, otherwisefalse.static booleanisNotEmpty(java.lang.String s)Returnstrueifsis neithernullnor the empty string, otherwisefalse.static java.lang.Stringjoin(java.lang.Iterable<?> iterable)Joins the elements of the providedIterableinto a single String containing the provided elements with the default separator ", ".static java.lang.Stringjoin(java.lang.Iterable<?> iterable, java.lang.String separator)Joins the elements of the providedIterableinto a single String containing the provided elements with the given separator.static <T> java.lang.Stringjoin(java.lang.Iterable<T> iterable, java.util.function.Function<? super T,java.lang.String> toString)Joins the elements of the providedIterableinto a single String containing the provided elements, converted to String with the giventoStringFunction, with the default separator ", ".static <T> java.lang.Stringjoin(java.lang.Iterable<T> iterable, java.util.function.Function<? super T,java.lang.String> toString, java.lang.String separator)Joins the elements of the providedIterableinto a single String containing the provided elements, converted to String with the giventoStringFunction, with the given separator.static java.lang.Stringjoin(java.lang.Object[] objectArray)Joins the elements of the provided array into a single String containing the provided elements with the default separator ", ".static java.lang.Stringjoin(java.lang.Object[] objectArray, java.lang.String separator)Joins the elements of the provided array into a single String containing the provided elements with the given separator.static java.lang.Stringjoin(java.util.Collection<?> collection, java.lang.String separator)Joins the elements of the providedCollectioninto a single String containing the provided elements with the given separator.static java.lang.StringtoLowerFirstChar(java.lang.String string)
-
-
-
Field Detail
-
EMPTY
public static final java.lang.String EMPTY
- See Also:
- Constant Field Values
-
-
Method Detail
-
isEmpty
public static final boolean isEmpty(java.lang.String s)
Returnstrueifsis eithernullor the empty string, otherwisefalse.
-
isNotEmpty
public static final boolean isNotEmpty(java.lang.String s)
Returnstrueifsis neithernullnor the empty string, otherwisefalse.
-
isBlank
public static final boolean isBlank(java.lang.String s)
Returnstrueifsis eithernull, the empty string or a string that only contains whitespace, otherwisefalse.
-
isNotBlank
public static final boolean isNotBlank(java.lang.String s)
Returnstrueifsis neithernull, the empty string nor a string that only contains whitespace, otherwisefalse.
-
join
public static final java.lang.String join(java.util.Collection<?> collection, java.lang.String separator)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
public static final java.lang.String join(java.lang.Iterable<?> iterable, java.lang.String separator)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
public static final java.lang.String join(java.lang.Iterable<?> iterable)
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
public static final java.lang.String join(java.lang.Object[] objectArray)
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
public static final java.lang.String join(java.lang.Object[] objectArray, java.lang.String separator)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
public static final <T> java.lang.String join(java.lang.Iterable<T> iterable, java.util.function.Function<? super T,java.lang.String> toString)Joins the elements of the providedIterableinto a single String containing the provided elements, converted to String with the giventoStringFunction, with the default separator ", ". No delimiter is added before or after the list.- Parameters:
iterable- the Collection of values to join together, may benulltoString- theFunctionto convert an element from theIterableto a String- Returns:
- the joined String,
nullif the collection isnull
-
join
public static final <T> java.lang.String join(java.lang.Iterable<T> iterable, java.util.function.Function<? super T,java.lang.String> toString, java.lang.String separator)Joins the elements of the providedIterableinto a single String containing the provided elements, converted to String with the giventoStringFunction, 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 ""toString- theFunctionto convert an element from theIterableto a String- Returns:
- the joined String,
nullif the collection isnull
-
toLowerFirstChar
public static final java.lang.String toLowerFirstChar(java.lang.String string)
-
-