Class StreamUtils
- java.lang.Object
-
- com.commercetools.sync.commons.utils.StreamUtils
-
public final class StreamUtils extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T,S>
java.util.stream.Stream<S>filterNullAndMap(java.util.stream.Stream<T> elements, java.util.function.Function<T,S> mapper)
Applies the suppliedmapper
function on every non-null element in the suppliedStream
ofelements
.
-
-
-
Method Detail
-
filterNullAndMap
@Nonnull public static <T,S> java.util.stream.Stream<S> filterNullAndMap(@Nonnull java.util.stream.Stream<T> elements, @Nonnull java.util.function.Function<T,S> mapper)
Applies the suppliedmapper
function on every non-null element in the suppliedStream
ofelements
.- Type Parameters:
T
- the type of the elements in the stream.S
- the resulting type after applying the mapper function on an element.- Parameters:
elements
- the stream of elements.mapper
- the mapper function to apply on every element.- Returns:
- a stream of the resulting mapped elements.
-
-