public final class StreamUtils
extends java.lang.Object
Modifier and Type | Method and 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 supplied
mapper function on every non-null element in the supplied Stream of elements . |
@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)
mapper
function on every non-null element in the supplied Stream
of elements
.T
- the type of the elements in the stream.S
- the resulting type after applying the mapper function on an element.elements
- the stream of elements.mapper
- the mapper function to apply on every element.