Class StringImplode

java.lang.Object
com.helger.base.string.StringImplode

@Immutable public final class StringImplode extends Object
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    A simple builder that allows to implode collections of arguments with a lot of customization.
    static class 
    A simple builder that allows to implode maps of arguments with a lot of customization.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <KEYTYPE, VALUETYPE>
    String
    getImploded(char cSepOuter, char cSepInner, Map<KEYTYPE,VALUETYPE> aElements)
    Get a concatenated String from all elements of the passed map, separated by the specified separator chars.
    static <ELEMENTTYPE>
    String
    getImploded(char cSep, ELEMENTTYPE... aElements)
    Get a concatenated String from all elements of the passed array, separated by the specified separator char.
    static <ELEMENTTYPE>
    String
    getImploded(char cSep, ELEMENTTYPE[] aElements, int nOfs, int nLen)
    Get a concatenated String from all elements of the passed array, separated by the specified separator char.
    static String
    getImploded(char cSep, Collection<?> aElements)
    Get a concatenated String from all elements of the passed container, separated by the specified separator char.
    static <ELEMENTTYPE>
    String
    getImploded(ELEMENTTYPE... aElements)
    Get a concatenated String from all elements of the passed array, without a separator.
    static <ELEMENTTYPE>
    String
    getImploded(ELEMENTTYPE[] aElements, int nOfs, int nLen)
    Get a concatenated String from all elements of the passed array, without a separator.
    static <ELEMENTTYPE>
    String
    getImploded(String sSep, ELEMENTTYPE... aElements)
    Get a concatenated String from all elements of the passed array, separated by the specified separator string.
    static <ELEMENTTYPE>
    String
    getImploded(String sSep, ELEMENTTYPE[] aElements, int nOfs, int nLen)
    Get a concatenated String from all elements of the passed array, separated by the specified separator string.
    static <KEYTYPE, VALUETYPE>
    String
    getImploded(String sSepOuter, String sSepInner, Map<KEYTYPE,VALUETYPE> aElements)
    Get a concatenated String from all elements of the passed map, separated by the specified separator strings.
    static String
    getImploded(String sSep, Collection<?> aElements)
    Get a concatenated String from all elements of the passed container, separated by the specified separator string.
    static String
    getImploded(Collection<?> aElements)
    Get a concatenated String from all elements of the passed container, without a separator.
    static <KEYTYPE, VALUETYPE>
    String
    getImplodedMapped(char cSepOuter, char cSepInner, Map<? extends KEYTYPE,? extends VALUETYPE> aElements, Function<? super KEYTYPE,String> aKeyMapper, Function<? super VALUETYPE,String> aValueMapper)
    Get a concatenated String from all elements of the passed map, separated by the specified separator chars.
    static <ELEMENTTYPE>
    String
    getImplodedMapped(char cSep, ELEMENTTYPE[] aElements, int nOfs, int nLen, Function<? super ELEMENTTYPE,String> aMapper)
    Get a concatenated String from all elements of the passed array, separated by the specified separator char.
    static <ELEMENTTYPE>
    String
    getImplodedMapped(char cSep, ELEMENTTYPE[] aElements, Function<? super ELEMENTTYPE,String> aMapper)
    Get a concatenated String from all elements of the passed array, separated by the specified separator char.
    static <ELEMENTTYPE>
    String
    getImplodedMapped(char cSep, Collection<? extends ELEMENTTYPE> aElements, Function<? super ELEMENTTYPE,String> aMapper)
    Get a concatenated String from all elements of the passed container, separated by the specified separator char.
    static <ELEMENTTYPE>
    String
    getImplodedMapped(ELEMENTTYPE[] aElements, int nOfs, int nLen, Function<? super ELEMENTTYPE,String> aMapper)
    Get a concatenated String from all elements of the passed array, without a separator.
    static <ELEMENTTYPE>
    String
    getImplodedMapped(ELEMENTTYPE[] aElements, Function<? super ELEMENTTYPE,String> aMapper)
    Get a concatenated String from all elements of the passed array, without a separator.
    static <ELEMENTTYPE>
    String
    getImplodedMapped(String sSep, ELEMENTTYPE[] aElements, int nOfs, int nLen, Function<? super ELEMENTTYPE,String> aMapper)
    Get a concatenated String from all elements of the passed array, separated by the specified separator string.
    static <ELEMENTTYPE>
    String
    getImplodedMapped(String sSep, ELEMENTTYPE[] aElements, Function<? super ELEMENTTYPE,String> aMapper)
    Get a concatenated String from all elements of the passed array, separated by the specified separator string.
    static <KEYTYPE, VALUETYPE>
    String
    getImplodedMapped(String sSepOuter, String sSepInner, Map<? extends KEYTYPE,? extends VALUETYPE> aElements, Function<? super KEYTYPE,String> aKeyMapper, Function<? super VALUETYPE,String> aValueMapper)
    Get a concatenated String from all elements of the passed map, separated by the specified separator strings.
    static <ELEMENTTYPE>
    String
    getImplodedMapped(String sSep, Collection<? extends ELEMENTTYPE> aElements, Function<? super ELEMENTTYPE,String> aMapper)
    Get a concatenated String from all elements of the passed container, separated by the specified separator string.
    static <ELEMENTTYPE>
    String
    getImplodedMapped(Collection<? extends ELEMENTTYPE> aElements, Function<? super ELEMENTTYPE,String> aMapper)
    Get a concatenated String from all elements of the passed container, without a separator.
    static <ELEMENTTYPE>
    String
    getImplodedMappedNonEmpty(char cSep, ELEMENTTYPE[] aElements, int nOfs, int nLen, Function<? super ELEMENTTYPE,String> aMapper)
    Get a concatenated String from all elements of the passed array, separated by the specified separator char.
    static <ELEMENTTYPE>
    String
    getImplodedMappedNonEmpty(char cSep, ELEMENTTYPE[] aElements, Function<? super ELEMENTTYPE,String> aMapper)
    Get a concatenated String from all elements of the passed array, separated by the specified separator char.
    static <ELEMENTTYPE>
    String
    getImplodedMappedNonEmpty(char cSep, Collection<? extends ELEMENTTYPE> aElements, Function<? super ELEMENTTYPE,String> aMapper)
    Get a concatenated String from all non-null and non empty elements of the passed container, separated by the specified separator char.
    static <ELEMENTTYPE>
    String
    getImplodedMappedNonEmpty(ELEMENTTYPE[] aElements, Function<? super ELEMENTTYPE,String> aMapper)
    Get a concatenated String from all non-null and non empty elements of the passed container without a separator string.
    static <ELEMENTTYPE>
    String
    getImplodedMappedNonEmpty(String sSep, ELEMENTTYPE[] aElements, int nOfs, int nLen, Function<? super ELEMENTTYPE,String> aMapper)
    Get a concatenated String from all elements of the passed array, separated by the specified separator string.
    static <ELEMENTTYPE>
    String
    getImplodedMappedNonEmpty(String sSep, ELEMENTTYPE[] aElements, Function<? super ELEMENTTYPE,String> aMapper)
    Get a concatenated String from all elements of the passed array, separated by the specified separator string.
    static <ELEMENTTYPE>
    String
    getImplodedMappedNonEmpty(String sSep, Collection<? extends ELEMENTTYPE> aElements, Function<? super ELEMENTTYPE,String> aMapper)
    Get a concatenated String from all non-null and non empty elements of the passed container, separated by the specified separator string.
    static <ELEMENTTYPE>
    String
    getImplodedMappedNonEmpty(Collection<? extends ELEMENTTYPE> aElements, Function<? super ELEMENTTYPE,String> aMapper)
    Get a concatenated String from all non-null and non empty elements of the passed container without a separator string.
    static String
    getImplodedNonEmpty(char cSep, String... aElements)
    Get a concatenated String from all elements of the passed array, separated by the specified separator char.
    static String
    getImplodedNonEmpty(char cSep, String[] aElements, int nOfs, int nLen)
    Get a concatenated String from all elements of the passed array, separated by the specified separator char.
    static String
    getImplodedNonEmpty(char cSep, Collection<String> aElements)
    Get a concatenated String from all non-null and non empty elements of the passed container, separated by the specified separator char.
    static String
    getImplodedNonEmpty(String sSep, String... aElements)
    Get a concatenated String from all elements of the passed array, separated by the specified separator string.
    static String
    getImplodedNonEmpty(String sSep, String[] aElements, int nOfs, int nLen)
    Get a concatenated String from all elements of the passed array, separated by the specified separator string.
    static String
    Get a concatenated String from all non-null and non empty elements of the passed container, separated by the specified separator string.
    static String
    Get a concatenated String from all non-null and non empty elements of the passed container without a separator string.
     
     

    Methods inherited from class java.lang.Object

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

    • imploder

      @Nonnull public static StringImplode.ImploderBuilder imploder()
      Returns:
      A new StringImplode.ImploderBuilder.
      Since:
      10.0.0
    • getImploded

      @Nonnull public static String getImploded(@Nullable Collection<?> aElements)
      Get a concatenated String from all elements of the passed container, without a separator. Even null elements are added.
      Parameters:
      aElements - The container to convert. May be null or empty.
      Returns:
      The concatenated string.
    • getImplodedMapped

      @Nonnull public static <ELEMENTTYPE> String getImplodedMapped(@Nullable Collection<? extends ELEMENTTYPE> aElements, @Nonnull Function<? super ELEMENTTYPE,String> aMapper)
      Get a concatenated String from all elements of the passed container, without a separator. Even null elements are added.
      Type Parameters:
      ELEMENTTYPE - Iterable element type
      Parameters:
      aElements - The container to convert. May be null or empty.
      aMapper - The mapping function to convert from ELEMENTTYPE to String. May not be null.
      Returns:
      The concatenated string.
      Since:
      8.5.6
    • getImploded

      @Nonnull public static String getImploded(@Nonnull String sSep, @Nullable Collection<?> aElements)
      Get a concatenated String from all elements of the passed container, separated by the specified separator string. Even null elements are added.
      Parameters:
      sSep - The separator to use. May not be null.
      aElements - The container to convert. May be null or empty.
      Returns:
      The concatenated string.
    • getImploded

      @Nonnull public static String getImploded(char cSep, @Nullable Collection<?> aElements)
      Get a concatenated String from all elements of the passed container, separated by the specified separator char. Even null elements are added.
      Parameters:
      cSep - The separator to use.
      aElements - The container to convert. May be null or empty.
      Returns:
      The concatenated string.
    • getImplodedMapped

      @Nonnull public static <ELEMENTTYPE> String getImplodedMapped(@Nonnull String sSep, @Nullable Collection<? extends ELEMENTTYPE> aElements, @Nonnull Function<? super ELEMENTTYPE,String> aMapper)
      Get a concatenated String from all elements of the passed container, separated by the specified separator string. Even null elements are added.
      Type Parameters:
      ELEMENTTYPE - The element type of the collection to be imploded
      Parameters:
      sSep - The separator to use. May not be null.
      aElements - The container to convert. May be null or empty.
      aMapper - The mapping function to convert from ELEMENTTYPE to String. May not be null.
      Returns:
      The concatenated string.
      Since:
      8.5.6
    • getImplodedMapped

      @Nonnull public static <ELEMENTTYPE> String getImplodedMapped(char cSep, @Nullable Collection<? extends ELEMENTTYPE> aElements, @Nonnull Function<? super ELEMENTTYPE,String> aMapper)
      Get a concatenated String from all elements of the passed container, separated by the specified separator char. Even null elements are added.
      Type Parameters:
      ELEMENTTYPE - The element type of the collection to be imploded
      Parameters:
      cSep - The separator to use.
      aElements - The container to convert. May be null or empty.
      aMapper - The mapping function to convert from ELEMENTTYPE to String. May not be null.
      Returns:
      The concatenated string.
      Since:
      8.5.6
    • getImploded

      @Nonnull @SafeVarargs public static <ELEMENTTYPE> String getImploded(@Nullable ELEMENTTYPE... aElements)
      Get a concatenated String from all elements of the passed array, without a separator.
      Type Parameters:
      ELEMENTTYPE - The type of elements to be imploded.
      Parameters:
      aElements - The container to convert. May be null or empty.
      Returns:
      The concatenated string.
    • getImploded

      @Nonnull public static <ELEMENTTYPE> String getImploded(@Nullable ELEMENTTYPE[] aElements, @Nonnegative int nOfs, @Nonnegative int nLen)
      Get a concatenated String from all elements of the passed array, without a separator.
      Type Parameters:
      ELEMENTTYPE - The type of elements to be imploded.
      Parameters:
      aElements - The container to convert. May be null or empty.
      nOfs - The offset to start from.
      nLen - The number of elements to implode.
      Returns:
      The concatenated string.
    • getImplodedMapped

      @Nonnull public static <ELEMENTTYPE> String getImplodedMapped(@Nullable ELEMENTTYPE[] aElements, @Nonnull Function<? super ELEMENTTYPE,String> aMapper)
      Get a concatenated String from all elements of the passed array, without a separator.
      Type Parameters:
      ELEMENTTYPE - The type of elements to be imploded.
      Parameters:
      aElements - The container to convert. May be null or empty.
      aMapper - The mapping function to convert from ELEMENTTYPE to String. May not be null.
      Returns:
      The concatenated string.
      Since:
      8.5.6
    • getImplodedMapped

      @Nonnull public static <ELEMENTTYPE> String getImplodedMapped(@Nullable ELEMENTTYPE[] aElements, @Nonnegative int nOfs, @Nonnegative int nLen, @Nonnull Function<? super ELEMENTTYPE,String> aMapper)
      Get a concatenated String from all elements of the passed array, without a separator.
      Type Parameters:
      ELEMENTTYPE - The type of elements to be imploded.
      Parameters:
      aElements - The container to convert. May be null or empty.
      nOfs - The offset to start from.
      nLen - The number of elements to implode.
      aMapper - The mapping function to convert from ELEMENTTYPE to String. May not be null.
      Returns:
      The concatenated string.
      Since:
      8.5.6
    • getImploded

      @Nonnull @SafeVarargs public static <ELEMENTTYPE> String getImploded(@Nonnull String sSep, @Nullable ELEMENTTYPE... aElements)
      Get a concatenated String from all elements of the passed array, separated by the specified separator string.
      Type Parameters:
      ELEMENTTYPE - The type of elements to be imploded.
      Parameters:
      sSep - The separator to use. May not be null.
      aElements - The container to convert. May be null or empty.
      Returns:
      The concatenated string.
    • getImploded

      @Nonnull @SafeVarargs public static <ELEMENTTYPE> String getImploded(char cSep, @Nullable ELEMENTTYPE... aElements)
      Get a concatenated String from all elements of the passed array, separated by the specified separator char.
      Type Parameters:
      ELEMENTTYPE - The type of elements to be imploded.
      Parameters:
      cSep - The separator to use.
      aElements - The container to convert. May be null or empty.
      Returns:
      The concatenated string.
    • getImploded

      @Nonnull public static <ELEMENTTYPE> String getImploded(@Nonnull String sSep, @Nullable ELEMENTTYPE[] aElements, @Nonnegative int nOfs, @Nonnegative int nLen)
      Get a concatenated String from all elements of the passed array, separated by the specified separator string.
      Type Parameters:
      ELEMENTTYPE - The type of elements to be imploded.
      Parameters:
      sSep - The separator to use. May not be null.
      aElements - The container to convert. May be null or empty.
      nOfs - The offset to start from.
      nLen - The number of elements to implode.
      Returns:
      The concatenated string.
    • getImplodedMapped

      @Nonnull public static <ELEMENTTYPE> String getImplodedMapped(@Nonnull String sSep, @Nullable ELEMENTTYPE[] aElements, @Nonnull Function<? super ELEMENTTYPE,String> aMapper)
      Get a concatenated String from all elements of the passed array, separated by the specified separator string.
      Type Parameters:
      ELEMENTTYPE - The type of elements to be imploded.
      Parameters:
      sSep - The separator to use. May not be null.
      aElements - The container to convert. May be null or empty.
      aMapper - The mapping function to convert from ELEMENTTYPE to String. May not be null.
      Returns:
      The concatenated string.
      Since:
      8.5.6
    • getImplodedMapped

      @Nonnull public static <ELEMENTTYPE> String getImplodedMapped(char cSep, @Nullable ELEMENTTYPE[] aElements, @Nonnull Function<? super ELEMENTTYPE,String> aMapper)
      Get a concatenated String from all elements of the passed array, separated by the specified separator char.
      Type Parameters:
      ELEMENTTYPE - The type of elements to be imploded.
      Parameters:
      cSep - The separator to use.
      aElements - The container to convert. May be null or empty.
      aMapper - The mapping function to convert from ELEMENTTYPE to String. May not be null.
      Returns:
      The concatenated string.
      Since:
      8.5.6
    • getImplodedMapped

      @Nonnull public static <ELEMENTTYPE> String getImplodedMapped(char cSep, @Nullable ELEMENTTYPE[] aElements, @Nonnegative int nOfs, @Nonnegative int nLen, @Nonnull Function<? super ELEMENTTYPE,String> aMapper)
      Get a concatenated String from all elements of the passed array, separated by the specified separator char.
      Type Parameters:
      ELEMENTTYPE - The type of elements to be imploded.
      Parameters:
      cSep - The separator to use.
      aElements - The container to convert. May be null or empty.
      nOfs - The offset to start from.
      nLen - The number of elements to implode.
      aMapper - The mapping function to convert from ELEMENTTYPE to String. May not be null.
      Returns:
      The concatenated string.
      Since:
      8.5.6
    • getImplodedMapped

      @Nonnull public static <ELEMENTTYPE> String getImplodedMapped(@Nonnull String sSep, @Nullable ELEMENTTYPE[] aElements, @Nonnegative int nOfs, @Nonnegative int nLen, @Nonnull Function<? super ELEMENTTYPE,String> aMapper)
      Get a concatenated String from all elements of the passed array, separated by the specified separator string.
      Type Parameters:
      ELEMENTTYPE - The type of elements to be imploded.
      Parameters:
      sSep - The separator to use. May not be null.
      aElements - The container to convert. May be null or empty.
      nOfs - The offset to start from.
      nLen - The number of elements to implode.
      aMapper - The mapping function to convert from ELEMENTTYPE to String. May not be null.
      Returns:
      The concatenated string.
      Since:
      8.5.6
    • getImploded

      @Nonnull public static <ELEMENTTYPE> String getImploded(char cSep, @Nullable ELEMENTTYPE[] aElements, @Nonnegative int nOfs, @Nonnegative int nLen)
      Get a concatenated String from all elements of the passed array, separated by the specified separator char.
      Type Parameters:
      ELEMENTTYPE - The type of elements to be imploded.
      Parameters:
      cSep - The separator to use.
      aElements - The container to convert. May be null or empty.
      nOfs - The offset to start from.
      nLen - The number of elements to implode.
      Returns:
      The concatenated string.
    • getImplodedNonEmpty

      @Nonnull public static String getImplodedNonEmpty(@Nullable Collection<String> aElements)
      Get a concatenated String from all non-null and non empty elements of the passed container without a separator string. This the very generic version of getConcatenatedOnDemand for an arbitrary number of elements.
      Parameters:
      aElements - The container to convert. May be null or empty.
      Returns:
      The concatenated string.
    • getImplodedMappedNonEmpty

      @Nonnull public static <ELEMENTTYPE> String getImplodedMappedNonEmpty(@Nullable Collection<? extends ELEMENTTYPE> aElements, @Nonnull Function<? super ELEMENTTYPE,String> aMapper)
      Get a concatenated String from all non-null and non empty elements of the passed container without a separator string. This the very generic version of getConcatenatedOnDemand for an arbitrary number of elements.
      Type Parameters:
      ELEMENTTYPE - Iterable element type
      Parameters:
      aElements - The container to convert. May be null or empty.
      aMapper - The mapping function to convert from ELEMENTTYPE to String. May not be null.
      Returns:
      The concatenated string.
      Since:
      8.5.6
    • getImplodedMappedNonEmpty

      @Nonnull public static <ELEMENTTYPE> String getImplodedMappedNonEmpty(@Nullable ELEMENTTYPE[] aElements, @Nonnull Function<? super ELEMENTTYPE,String> aMapper)
      Get a concatenated String from all non-null and non empty elements of the passed container without a separator string. This the very generic version of getConcatenatedOnDemand for an arbitrary number of elements.
      Type Parameters:
      ELEMENTTYPE - Array component type
      Parameters:
      aElements - The array to convert. May be null or empty.
      aMapper - The mapping function to convert from ELEMENTTYPE to String. May not be null.
      Returns:
      The concatenated string.
      Since:
      8.5.6
    • getImplodedNonEmpty

      @Nonnull public static String getImplodedNonEmpty(@Nonnull String sSep, @Nullable Collection<String> aElements)
      Get a concatenated String from all non-null and non empty elements of the passed container, separated by the specified separator string. This the very generic version of getConcatenatedOnDemand for an arbitrary number of elements.
      Parameters:
      sSep - The separator to use. May not be null.
      aElements - The container to convert. May be null or empty.
      Returns:
      The concatenated string.
    • getImplodedNonEmpty

      @Nonnull public static String getImplodedNonEmpty(char cSep, @Nullable Collection<String> aElements)
      Get a concatenated String from all non-null and non empty elements of the passed container, separated by the specified separator char. This the very generic version of getConcatenatedOnDemand for an arbitrary number of elements.
      Parameters:
      cSep - The separator to use.
      aElements - The container to convert. May be null or empty.
      Returns:
      The concatenated string.
    • getImplodedMappedNonEmpty

      @Nonnull public static <ELEMENTTYPE> String getImplodedMappedNonEmpty(@Nonnull String sSep, @Nullable Collection<? extends ELEMENTTYPE> aElements, @Nonnull Function<? super ELEMENTTYPE,String> aMapper)
      Get a concatenated String from all non-null and non empty elements of the passed container, separated by the specified separator string. This the very generic version of getConcatenatedOnDemand for an arbitrary number of elements.
      Type Parameters:
      ELEMENTTYPE - The element type of the collection to be imploded
      Parameters:
      sSep - The separator to use. May not be null.
      aElements - The container to convert. May be null or empty.
      aMapper - The mapping function to convert from ELEMENTTYPE to String. May not be null.
      Returns:
      The concatenated string.
      Since:
      8.5.6
    • getImplodedMappedNonEmpty

      @Nonnull public static <ELEMENTTYPE> String getImplodedMappedNonEmpty(char cSep, @Nullable Collection<? extends ELEMENTTYPE> aElements, @Nonnull Function<? super ELEMENTTYPE,String> aMapper)
      Get a concatenated String from all non-null and non empty elements of the passed container, separated by the specified separator char. This the very generic version of getConcatenatedOnDemand for an arbitrary number of elements.
      Type Parameters:
      ELEMENTTYPE - The element type of the collection to be imploded
      Parameters:
      cSep - The separator to use.
      aElements - The container to convert. May be null or empty.
      aMapper - The mapping function to convert from ELEMENTTYPE to String. May not be null.
      Returns:
      The concatenated string.
      Since:
      8.5.6
    • getImplodedNonEmpty

      @Nonnull public static String getImplodedNonEmpty(@Nonnull String sSep, @Nullable String... aElements)
      Get a concatenated String from all elements of the passed array, separated by the specified separator string. This the very generic version of getConcatenatedOnDemand for an arbitrary number of elements.
      Parameters:
      sSep - The separator to use. May not be null.
      aElements - The container to convert. May be null or empty.
      Returns:
      The concatenated string.
    • getImplodedNonEmpty

      @Nonnull public static String getImplodedNonEmpty(char cSep, @Nullable String... aElements)
      Get a concatenated String from all elements of the passed array, separated by the specified separator char. This the very generic version of getConcatenatedOnDemand for an arbitrary number of elements.
      Parameters:
      cSep - The separator to use.
      aElements - The container to convert. May be null or empty.
      Returns:
      The concatenated string.
    • getImplodedMappedNonEmpty

      @Nonnull public static <ELEMENTTYPE> String getImplodedMappedNonEmpty(@Nonnull String sSep, @Nullable ELEMENTTYPE[] aElements, @Nonnull Function<? super ELEMENTTYPE,String> aMapper)
      Get a concatenated String from all elements of the passed array, separated by the specified separator string. This the very generic version of getConcatenatedOnDemand for an arbitrary number of elements.
      Type Parameters:
      ELEMENTTYPE - Array component type
      Parameters:
      sSep - The separator to use. May not be null.
      aElements - The container to convert. May be null or empty.
      aMapper - The mapping function to convert from ELEMENTTYPE to String. May not be null.
      Returns:
      The concatenated string.
      Since:
      8.5.6
    • getImplodedMappedNonEmpty

      @Nonnull public static <ELEMENTTYPE> String getImplodedMappedNonEmpty(char cSep, @Nullable ELEMENTTYPE[] aElements, @Nonnull Function<? super ELEMENTTYPE,String> aMapper)
      Get a concatenated String from all elements of the passed array, separated by the specified separator char. This the very generic version of getConcatenatedOnDemand for an arbitrary number of elements.
      Type Parameters:
      ELEMENTTYPE - Array component type
      Parameters:
      cSep - The separator to use.
      aElements - The container to convert. May be null or empty.
      aMapper - The mapping function to convert from ELEMENTTYPE to String. May not be null.
      Returns:
      The concatenated string.
      Since:
      8.5.6
    • getImplodedNonEmpty

      @Nonnull public static String getImplodedNonEmpty(@Nonnull String sSep, @Nullable String[] aElements, @Nonnegative int nOfs, @Nonnegative int nLen)
      Get a concatenated String from all elements of the passed array, separated by the specified separator string. This the very generic version of getConcatenatedOnDemand for an arbitrary number of elements.
      Parameters:
      sSep - The separator to use. May not be null.
      aElements - The container to convert. May be null or empty.
      nOfs - The offset to start from.
      nLen - The number of elements to implode.
      Returns:
      The concatenated string.
    • getImplodedNonEmpty

      @Nonnull public static String getImplodedNonEmpty(char cSep, @Nullable String[] aElements, @Nonnegative int nOfs, @Nonnegative int nLen)
      Get a concatenated String from all elements of the passed array, separated by the specified separator char. This the very generic version of getConcatenatedOnDemand for an arbitrary number of elements.
      Parameters:
      cSep - The separator to use.
      aElements - The container to convert. May be null or empty.
      nOfs - The offset to start from.
      nLen - The number of elements to implode.
      Returns:
      The concatenated string.
    • getImplodedMappedNonEmpty

      @Nonnull public static <ELEMENTTYPE> String getImplodedMappedNonEmpty(@Nonnull String sSep, @Nullable ELEMENTTYPE[] aElements, @Nonnegative int nOfs, @Nonnegative int nLen, @Nonnull Function<? super ELEMENTTYPE,String> aMapper)
      Get a concatenated String from all elements of the passed array, separated by the specified separator string. This the very generic version of getConcatenatedOnDemand for an arbitrary number of elements.
      Type Parameters:
      ELEMENTTYPE - Array component type
      Parameters:
      sSep - The separator to use. May not be null.
      aElements - The container to convert. May be null or empty.
      nOfs - The offset to start from.
      nLen - The number of elements to implode.
      aMapper - The mapping function to convert from ELEMENTTYPE to String. May not be null.
      Returns:
      The concatenated string.
      Since:
      8.5.6
    • getImplodedMappedNonEmpty

      @Nonnull public static <ELEMENTTYPE> String getImplodedMappedNonEmpty(char cSep, @Nullable ELEMENTTYPE[] aElements, @Nonnegative int nOfs, @Nonnegative int nLen, @Nonnull Function<? super ELEMENTTYPE,String> aMapper)
      Get a concatenated String from all elements of the passed array, separated by the specified separator char. This the very generic version of getConcatenatedOnDemand for an arbitrary number of elements.
      Type Parameters:
      ELEMENTTYPE - Array component type
      Parameters:
      cSep - The separator to use.
      aElements - The container to convert. May be null or empty.
      nOfs - The offset to start from.
      nLen - The number of elements to implode.
      aMapper - The mapping function to convert from ELEMENTTYPE to String. May not be null.
      Returns:
      The concatenated string.
      Since:
      8.5.6
    • imploderMap

      @Nonnull public static StringImplode.ImploderBuilderMap imploderMap()
      Returns:
      A new StringImplode.ImploderBuilderMap.
      Since:
      10.0.0
    • getImploded

      @Nonnull public static <KEYTYPE, VALUETYPE> String getImploded(@Nonnull String sSepOuter, @Nonnull String sSepInner, @Nullable Map<KEYTYPE,VALUETYPE> aElements)
      Get a concatenated String from all elements of the passed map, separated by the specified separator strings.
      Type Parameters:
      KEYTYPE - Map key type
      VALUETYPE - Map value type
      Parameters:
      sSepOuter - The separator to use for separating the map entries. May not be null.
      sSepInner - The separator to use for separating the key from the value. May not be null.
      aElements - The map to convert. May be null or empty.
      Returns:
      The concatenated string.
    • getImploded

      @Nonnull public static <KEYTYPE, VALUETYPE> String getImploded(char cSepOuter, char cSepInner, @Nullable Map<KEYTYPE,VALUETYPE> aElements)
      Get a concatenated String from all elements of the passed map, separated by the specified separator chars.
      Type Parameters:
      KEYTYPE - Map key type
      VALUETYPE - Map value type
      Parameters:
      cSepOuter - The separator to use for separating the map entries.
      cSepInner - The separator to use for separating the key from the value.
      aElements - The map to convert. May be null or empty.
      Returns:
      The concatenated string.
    • getImplodedMapped

      @Nonnull public static <KEYTYPE, VALUETYPE> String getImplodedMapped(@Nonnull String sSepOuter, @Nonnull String sSepInner, @Nullable Map<? extends KEYTYPE,? extends VALUETYPE> aElements, @Nonnull Function<? super KEYTYPE,String> aKeyMapper, @Nonnull Function<? super VALUETYPE,String> aValueMapper)
      Get a concatenated String from all elements of the passed map, separated by the specified separator strings.
      Type Parameters:
      KEYTYPE - Map key type
      VALUETYPE - Map value type
      Parameters:
      sSepOuter - The separator to use for separating the map entries. May not be null.
      sSepInner - The separator to use for separating the key from the value. May not be null.
      aElements - The map to convert. May be null or empty.
      aKeyMapper - The mapping function to convert from KEYTYPE to String. May not be null.
      aValueMapper - The mapping function to convert from VALUETYPE to String. May not be null.
      Returns:
      The concatenated string.
      Since:
      8.5.6
    • getImplodedMapped

      @Nonnull public static <KEYTYPE, VALUETYPE> String getImplodedMapped(char cSepOuter, char cSepInner, @Nullable Map<? extends KEYTYPE,? extends VALUETYPE> aElements, @Nonnull Function<? super KEYTYPE,String> aKeyMapper, @Nonnull Function<? super VALUETYPE,String> aValueMapper)
      Get a concatenated String from all elements of the passed map, separated by the specified separator chars.
      Type Parameters:
      KEYTYPE - Map key type
      VALUETYPE - Map value type
      Parameters:
      cSepOuter - The separator to use for separating the map entries.
      cSepInner - The separator to use for separating the key from the value.
      aElements - The map to convert. May be null or empty.
      aKeyMapper - The mapping function to convert from KEYTYPE to String. May not be null.
      aValueMapper - The mapping function to convert from VALUETYPE to String. May not be null.
      Returns:
      The concatenated string.
      Since:
      8.5.6