
public final class StreamUtils extends Object
| Modifier | Constructor and Description |
|---|---|
private |
StreamUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <E> Stream<E> |
flatten(E target,
Function<? super E,? extends Stream<? extends E>> extractor)
Flattens a recursive, non circular data structure into a
Stream. |
public static <E> Stream<E> flatten(E target, Function<? super E,? extends Stream<? extends E>> extractor)
Stream.E - the type of objecttarget - the root element of the structureextractor - the function that maps a node of the structure to a stream of
its childrenStream walking through the data structure