io.github.avegera.stream.utils.Strings Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of stream-utils Show documentation
Show all versions of stream-utils Show documentation
The library of laconic method-aliases for the safety Stream API operations on Java-collections
The newest version!
package io.github.avegera.stream.utils;
import java.util.Collection;
import java.util.Objects;
import static io.github.avegera.stream.utils.Streams.safeStream;
import static java.util.stream.Collectors.joining;
/**
* The class contains laconic method-aliases for safe stream operations with collections in Java.
* The result of class methods operations is {@link java.lang.String}
*/
public class Strings {
private Strings() {
//empty private constructor
}
public static String joinToString(Collection> collection, String delimiter) {
return safeStream(collection)
.map(Objects::toString)
.collect(joining(delimiter));
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy