Class IpsStringUtils

java.lang.Object
org.faktorips.runtime.internal.IpsStringUtils

public final class IpsStringUtils extends Object
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
    Modifier and Type
    Field
    Description
    static final String
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static final boolean
    Returns true if s is either null, the empty string or a string that only contains whitespace, otherwise false.
    static final boolean
    Returns true if s is either null or the empty string, otherwise false.
    static final boolean
    Returns true if s is neither null, the empty string nor a string that only contains whitespace, otherwise false.
    static final boolean
    Returns true if s is neither null nor the empty string, otherwise false.
    static final String
    join(Iterable<?> iterable)
    Joins the elements of the provided Iterable into a single String containing the provided elements with the default separator ", ".
    static final String
    join(Iterable<?> iterable, String separator)
    Joins the elements of the provided Iterable into a single String containing the provided elements with the given separator.
    static final <T> String
    join(Iterable<T> iterable, Function<? super T,String> toString)
    Joins the elements of the provided Iterable into a single String containing the provided elements, converted to String with the given toString Function, with the default separator ", ".
    static final <T> String
    join(Iterable<T> iterable, Function<? super T,String> toString, String separator)
    Joins the elements of the provided Iterable into a single String containing the provided elements, converted to String with the given toString Function, with the given separator.
    static final String
    join(Object[] objectArray)
    Joins the elements of the provided array into a single String containing the provided elements with the default separator ", ".
    static final String
    join(Object[] objectArray, String separator)
    Joins the elements of the provided array into a single String containing the provided elements with the given separator.
    static final String
    join(Collection<?> collection, String separator)
    Joins the elements of the provided Collection into a single String containing the provided elements with the given separator.
    static final String
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Method Details

    • isEmpty

      public static final boolean isEmpty(String s)
      Returns true if s is either null or the empty string, otherwise false.
    • isNotEmpty

      public static final boolean isNotEmpty(String s)
      Returns true if s is neither null nor the empty string, otherwise false.
    • isBlank

      public static final boolean isBlank(String s)
      Returns true if s is either null, the empty string or a string that only contains whitespace, otherwise false.
    • isNotBlank

      public static final boolean isNotBlank(String s)
      Returns true if s is neither null, the empty string nor a string that only contains whitespace, otherwise false.
    • join

      public static final String join(Collection<?> collection, String separator)
      Joins the elements of the provided Collection into 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 be null
      separator - the separator to use, null treated as ""
      Returns:
      the joined String, empty if the collection is null
    • join

      public static final String join(Iterable<?> iterable, String separator)
      Joins the elements of the provided Iterable into 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 be null
      separator - the separator to use, null treated as ""
      Returns:
      the joined String, empty if the collection is null
    • join

      public static final String join(Iterable<?> iterable)
      Joins the elements of the provided Iterable into 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 be null
      Returns:
      the joined String, empty if the collection is null
    • join

      public static final String join(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 be null
      Returns:
      the joined String, empty if the collection is null
    • join

      public static final String join(Object[] objectArray, 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 be null
      separator - the separator to use, null treated as ""
      Returns:
      the joined String, empty if the collection is null
    • join

      public static final <T> String join(Iterable<T> iterable, Function<? super T,String> toString)
      Joins the elements of the provided Iterable into a single String containing the provided elements, converted to String with the given toString Function, with the default separator ", ". No delimiter is added before or after the list.
      Parameters:
      iterable - the Collection of values to join together, may be null
      toString - the Function to convert an element from the Iterable to a String
      Returns:
      the joined String, null if the collection is null
    • join

      public static final <T> String join(Iterable<T> iterable, Function<? super T,String> toString, String separator)
      Joins the elements of the provided Iterable into a single String containing the provided elements, converted to String with the given toString Function, with the given separator. No delimiter is added before or after the list.
      Parameters:
      iterable - the Collection of values to join together, may be null
      separator - the separator to use, null treated as ""
      toString - the Function to convert an element from the Iterable to a String
      Returns:
      the joined String, null if the collection is null
    • toLowerFirstChar

      public static final String toLowerFirstChar(String string)