Package com.helger.base.string
Class StringImplode
java.lang.Object
com.helger.base.string.StringImplode
Helper class for joining (imploding) collections and arrays into a single
string with a configurable separator.
- Author:
- Philip Helger
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA simple builder that allows to implode collections of arguments with a lot of customization.static classA simple builder that allows to implode maps of arguments with a lot of customization. -
Method Summary
Modifier and TypeMethodDescriptionstatic <KEYTYPE,VALUETYPE>
@NonNull StringgetImploded(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.static <ELEMENTTYPE>
@NonNull StringgetImploded(char cSep, @Nullable ELEMENTTYPE... aElements) Get a concatenated String from all elements of the passed array, separated by the specified separator char.static <ELEMENTTYPE>
@NonNull StringgetImploded(char cSep, @Nullable ELEMENTTYPE[] aElements, int nOfs, int nLen) Get a concatenated String from all elements of the passed array, separated by the specified separator char.static @NonNull StringgetImploded(char cSep, @Nullable Collection<?> aElements) Get a concatenated String from all elements of the passed container, separated by the specified separator char.static <ELEMENTTYPE>
@NonNull StringgetImploded(@Nullable ELEMENTTYPE... aElements) Get a concatenated String from all elements of the passed array, without a separator.static <ELEMENTTYPE>
@NonNull StringgetImploded(@Nullable ELEMENTTYPE[] aElements, int nOfs, int nLen) Get a concatenated String from all elements of the passed array, without a separator.static <ELEMENTTYPE>
@NonNull StringgetImploded(@NonNull String sSep, @Nullable ELEMENTTYPE... aElements) Get a concatenated String from all elements of the passed array, separated by the specified separator string.static <ELEMENTTYPE>
@NonNull StringgetImploded(@NonNull String sSep, @Nullable 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>
@NonNull StringgetImploded(@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.static @NonNull StringgetImploded(@NonNull String sSep, @Nullable Collection<?> aElements) Get a concatenated String from all elements of the passed container, separated by the specified separator string.static @NonNull StringgetImploded(@Nullable Collection<?> aElements) Get a concatenated String from all elements of the passed container, without a separator.static <KEYTYPE,VALUETYPE>
@NonNull StringgetImplodedMapped(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.static <ELEMENTTYPE>
@NonNull StringgetImplodedMapped(char cSep, @Nullable ELEMENTTYPE[] aElements, int nOfs, 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.static <ELEMENTTYPE>
@NonNull StringgetImplodedMapped(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.static <ELEMENTTYPE>
@NonNull StringgetImplodedMapped(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.static <ELEMENTTYPE>
@NonNull StringgetImplodedMapped(@Nullable ELEMENTTYPE[] aElements, int nOfs, int nLen, @NonNull Function<? super ELEMENTTYPE, String> aMapper) Get a concatenated String from all elements of the passed array, without a separator.static <ELEMENTTYPE>
@NonNull StringgetImplodedMapped(@Nullable ELEMENTTYPE[] aElements, @NonNull Function<? super ELEMENTTYPE, String> aMapper) Get a concatenated String from all elements of the passed array, without a separator.static <ELEMENTTYPE>
@NonNull StringgetImplodedMapped(@NonNull String sSep, @Nullable ELEMENTTYPE[] aElements, int nOfs, 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.static <ELEMENTTYPE>
@NonNull StringgetImplodedMapped(@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.static <KEYTYPE,VALUETYPE>
@NonNull StringgetImplodedMapped(@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.static <ELEMENTTYPE>
@NonNull StringgetImplodedMapped(@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.static <ELEMENTTYPE>
@NonNull StringgetImplodedMapped(@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.static <ELEMENTTYPE>
@NonNull StringgetImplodedMappedNonEmpty(char cSep, @Nullable ELEMENTTYPE[] aElements, int nOfs, 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.static <ELEMENTTYPE>
@NonNull StringgetImplodedMappedNonEmpty(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.static <ELEMENTTYPE>
@NonNull StringgetImplodedMappedNonEmpty(char cSep, @Nullable Collection<? extends ELEMENTTYPE> aElements, @NonNull Function<? super ELEMENTTYPE, String> aMapper) Get a concatenated String from all non-nulland non empty elements of the passed container, separated by the specified separator char.static <ELEMENTTYPE>
@NonNull StringgetImplodedMappedNonEmpty(@Nullable ELEMENTTYPE[] aElements, @NonNull Function<? super ELEMENTTYPE, String> aMapper) Get a concatenated String from all non-nulland non empty elements of the passed container without a separator string.static <ELEMENTTYPE>
@NonNull StringgetImplodedMappedNonEmpty(@NonNull String sSep, @Nullable ELEMENTTYPE[] aElements, int nOfs, 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.static <ELEMENTTYPE>
@NonNull StringgetImplodedMappedNonEmpty(@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.static <ELEMENTTYPE>
@NonNull StringgetImplodedMappedNonEmpty(@NonNull String sSep, @Nullable Collection<? extends ELEMENTTYPE> aElements, @NonNull Function<? super ELEMENTTYPE, String> aMapper) Get a concatenated String from all non-nulland non empty elements of the passed container, separated by the specified separator string.static <ELEMENTTYPE>
@NonNull StringgetImplodedMappedNonEmpty(@Nullable Collection<? extends ELEMENTTYPE> aElements, @NonNull Function<? super ELEMENTTYPE, String> aMapper) Get a concatenated String from all non-nulland non empty elements of the passed container without a separator string.static @NonNull StringgetImplodedNonEmpty(char cSep, @Nullable String... aElements) Get a concatenated String from all elements of the passed array, separated by the specified separator char.static @NonNull StringgetImplodedNonEmpty(char cSep, @Nullable String[] aElements, int nOfs, int nLen) Get a concatenated String from all elements of the passed array, separated by the specified separator char.static @NonNull StringgetImplodedNonEmpty(char cSep, @Nullable Collection<String> aElements) Get a concatenated String from all non-nulland non empty elements of the passed container, separated by the specified separator char.static @NonNull StringgetImplodedNonEmpty(@NonNull String sSep, @Nullable String... aElements) Get a concatenated String from all elements of the passed array, separated by the specified separator string.static @NonNull StringgetImplodedNonEmpty(@NonNull String sSep, @Nullable String[] aElements, int nOfs, int nLen) Get a concatenated String from all elements of the passed array, separated by the specified separator string.static @NonNull StringgetImplodedNonEmpty(@NonNull String sSep, @Nullable Collection<String> aElements) Get a concatenated String from all non-nulland non empty elements of the passed container, separated by the specified separator string.static @NonNull StringgetImplodedNonEmpty(@Nullable Collection<String> aElements) Get a concatenated String from all non-nulland non empty elements of the passed container without a separator string.static @NonNull StringImplode.ImploderBuilderimploder()static @NonNull StringImplode.ImploderBuilderMap
-
Method Details
-
imploder
- Returns:
- A new
StringImplode.ImploderBuilder. - Since:
- 10.0.0
-
getImploded
Get a concatenated String from all elements of the passed container, without a separator. Evennullelements are added.- Parameters:
aElements- The container to convert. May benullor empty.- Returns:
- The concatenated string.
-
getImplodedMapped
public static <ELEMENTTYPE> @NonNull 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. Evennullelements are added.- Type Parameters:
ELEMENTTYPE- Iterable element type- Parameters:
aElements- The container to convert. May benullor empty.aMapper- The mapping function to convert from ELEMENTTYPE to String. May not benull.- Returns:
- The concatenated string.
- Since:
- 8.5.6
-
getImploded
Get a concatenated String from all elements of the passed container, separated by the specified separator string. Evennullelements are added.- Parameters:
sSep- The separator to use. May not benull.aElements- The container to convert. May benullor empty.- Returns:
- The concatenated string.
-
getImploded
Get a concatenated String from all elements of the passed container, separated by the specified separator char. Evennullelements are added.- Parameters:
cSep- The separator to use.aElements- The container to convert. May benullor empty.- Returns:
- The concatenated string.
-
getImplodedMapped
public static <ELEMENTTYPE> @NonNull 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. Evennullelements are added.- Type Parameters:
ELEMENTTYPE- The element type of the collection to be imploded- Parameters:
sSep- The separator to use. May not benull.aElements- The container to convert. May benullor empty.aMapper- The mapping function to convert from ELEMENTTYPE to String. May not benull.- Returns:
- The concatenated string.
- Since:
- 8.5.6
-
getImplodedMapped
public static <ELEMENTTYPE> @NonNull 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. Evennullelements 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 benullor empty.aMapper- The mapping function to convert from ELEMENTTYPE to String. May not benull.- Returns:
- The concatenated string.
- Since:
- 8.5.6
-
getImploded
@SafeVarargs public static <ELEMENTTYPE> @NonNull 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 benullor empty.- Returns:
- The concatenated string.
-
getImploded
public static <ELEMENTTYPE> @NonNull 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 benullor empty.nOfs- The offset to start from.nLen- The number of elements to implode.- Returns:
- The concatenated string.
-
getImplodedMapped
public static <ELEMENTTYPE> @NonNull 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 benullor empty.aMapper- The mapping function to convert from ELEMENTTYPE to String. May not benull.- Returns:
- The concatenated string.
- Since:
- 8.5.6
-
getImplodedMapped
public static <ELEMENTTYPE> @NonNull 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 benullor 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 benull.- Returns:
- The concatenated string.
- Since:
- 8.5.6
-
getImploded
@SafeVarargs public static <ELEMENTTYPE> @NonNull 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 benull.aElements- The container to convert. May benullor empty.- Returns:
- The concatenated string.
-
getImploded
@SafeVarargs public static <ELEMENTTYPE> @NonNull 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 benullor empty.- Returns:
- The concatenated string.
-
getImploded
public static <ELEMENTTYPE> @NonNull 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 benull.aElements- The container to convert. May benullor empty.nOfs- The offset to start from.nLen- The number of elements to implode.- Returns:
- The concatenated string.
-
getImplodedMapped
public static <ELEMENTTYPE> @NonNull 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 benull.aElements- The container to convert. May benullor empty.aMapper- The mapping function to convert from ELEMENTTYPE to String. May not benull.- Returns:
- The concatenated string.
- Since:
- 8.5.6
-
getImplodedMapped
public static <ELEMENTTYPE> @NonNull 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 benullor empty.aMapper- The mapping function to convert from ELEMENTTYPE to String. May not benull.- Returns:
- The concatenated string.
- Since:
- 8.5.6
-
getImplodedMapped
public static <ELEMENTTYPE> @NonNull 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 benullor 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 benull.- Returns:
- The concatenated string.
- Since:
- 8.5.6
-
getImplodedMapped
public static <ELEMENTTYPE> @NonNull 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 benull.aElements- The container to convert. May benullor 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 benull.- Returns:
- The concatenated string.
- Since:
- 8.5.6
-
getImploded
public static <ELEMENTTYPE> @NonNull 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 benullor empty.nOfs- The offset to start from.nLen- The number of elements to implode.- Returns:
- The concatenated string.
-
getImplodedNonEmpty
Get a concatenated String from all non-nulland 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 benullor empty.- Returns:
- The concatenated string.
-
getImplodedMappedNonEmpty
public static <ELEMENTTYPE> @NonNull String getImplodedMappedNonEmpty(@Nullable Collection<? extends ELEMENTTYPE> aElements, @NonNull Function<? super ELEMENTTYPE, String> aMapper) Get a concatenated String from all non-nulland 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 benullor empty.aMapper- The mapping function to convert from ELEMENTTYPE to String. May not benull.- Returns:
- The concatenated string.
- Since:
- 8.5.6
-
getImplodedMappedNonEmpty
public static <ELEMENTTYPE> @NonNull String getImplodedMappedNonEmpty(@Nullable ELEMENTTYPE[] aElements, @NonNull Function<? super ELEMENTTYPE, String> aMapper) Get a concatenated String from all non-nulland 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 benullor empty.aMapper- The mapping function to convert from ELEMENTTYPE to String. May not benull.- Returns:
- The concatenated string.
- Since:
- 8.5.6
-
getImplodedNonEmpty
public static @NonNull String getImplodedNonEmpty(@NonNull String sSep, @Nullable Collection<String> aElements) Get a concatenated String from all non-nulland 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 benull.aElements- The container to convert. May benullor empty.- Returns:
- The concatenated string.
-
getImplodedNonEmpty
public static @NonNull String getImplodedNonEmpty(char cSep, @Nullable Collection<String> aElements) Get a concatenated String from all non-nulland 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 benullor empty.- Returns:
- The concatenated string.
-
getImplodedMappedNonEmpty
public static <ELEMENTTYPE> @NonNull String getImplodedMappedNonEmpty(@NonNull String sSep, @Nullable Collection<? extends ELEMENTTYPE> aElements, @NonNull Function<? super ELEMENTTYPE, String> aMapper) Get a concatenated String from all non-nulland 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 benull.aElements- The container to convert. May benullor empty.aMapper- The mapping function to convert from ELEMENTTYPE to String. May not benull.- Returns:
- The concatenated string.
- Since:
- 8.5.6
-
getImplodedMappedNonEmpty
public static <ELEMENTTYPE> @NonNull String getImplodedMappedNonEmpty(char cSep, @Nullable Collection<? extends ELEMENTTYPE> aElements, @NonNull Function<? super ELEMENTTYPE, String> aMapper) Get a concatenated String from all non-nulland 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 benullor empty.aMapper- The mapping function to convert from ELEMENTTYPE to String. May not benull.- Returns:
- The concatenated string.
- Since:
- 8.5.6
-
getImplodedNonEmpty
public static @NonNull 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 benull.aElements- The container to convert. May benullor empty.- Returns:
- The concatenated string.
-
getImplodedNonEmpty
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 benullor empty.- Returns:
- The concatenated string.
-
getImplodedMappedNonEmpty
public static <ELEMENTTYPE> @NonNull 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 benull.aElements- The container to convert. May benullor empty.aMapper- The mapping function to convert from ELEMENTTYPE to String. May not benull.- Returns:
- The concatenated string.
- Since:
- 8.5.6
-
getImplodedMappedNonEmpty
public static <ELEMENTTYPE> @NonNull 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 benullor empty.aMapper- The mapping function to convert from ELEMENTTYPE to String. May not benull.- Returns:
- The concatenated string.
- Since:
- 8.5.6
-
getImplodedNonEmpty
public static @NonNull 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 benull.aElements- The container to convert. May benullor empty.nOfs- The offset to start from.nLen- The number of elements to implode.- Returns:
- The concatenated string.
-
getImplodedNonEmpty
public static @NonNull 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 benullor empty.nOfs- The offset to start from.nLen- The number of elements to implode.- Returns:
- The concatenated string.
-
getImplodedMappedNonEmpty
public static <ELEMENTTYPE> @NonNull 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 benull.aElements- The container to convert. May benullor 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 benull.- Returns:
- The concatenated string.
- Since:
- 8.5.6
-
getImplodedMappedNonEmpty
public static <ELEMENTTYPE> @NonNull 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 benullor 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 benull.- Returns:
- The concatenated string.
- Since:
- 8.5.6
-
imploderMap
- Returns:
- A new
StringImplode.ImploderBuilderMap. - Since:
- 10.0.0
-
getImploded
public static <KEYTYPE,VALUETYPE> @NonNull 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 typeVALUETYPE- Map value type- Parameters:
sSepOuter- The separator to use for separating the map entries. May not benull.sSepInner- The separator to use for separating the key from the value. May not benull.aElements- The map to convert. May benullor empty.- Returns:
- The concatenated string.
-
getImploded
public static <KEYTYPE,VALUETYPE> @NonNull 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 typeVALUETYPE- 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 benullor empty.- Returns:
- The concatenated string.
-
getImplodedMapped
public static <KEYTYPE,VALUETYPE> @NonNull 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 typeVALUETYPE- Map value type- Parameters:
sSepOuter- The separator to use for separating the map entries. May not benull.sSepInner- The separator to use for separating the key from the value. May not benull.aElements- The map to convert. May benullor empty.aKeyMapper- The mapping function to convert from KEYTYPE to String. May not benull.aValueMapper- The mapping function to convert from VALUETYPE to String. May not benull.- Returns:
- The concatenated string.
- Since:
- 8.5.6
-
getImplodedMapped
public static <KEYTYPE,VALUETYPE> @NonNull 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 typeVALUETYPE- 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 benullor empty.aKeyMapper- The mapping function to convert from KEYTYPE to String. May not benull.aValueMapper- The mapping function to convert from VALUETYPE to String. May not benull.- Returns:
- The concatenated string.
- Since:
- 8.5.6
-