java.lang.Object
com.speedment.jpastreamer.javasixteen.Java16StreamUtil
- Author:
- Per Minborg, Julia Gustafsson
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T,R> Stream<R> mapMulti(Stream<T> stream, BiConsumer<? super T, ? super Consumer<R>> mapper) Delegates a Stream::mapMulti operation to the Java platforms underlying default Stream implementation.static <T> DoubleStreammapMultiToDouble(Stream<T> stream, BiConsumer<? super T, ? super DoubleConsumer> mapper) Delegates a Stream::mapMultiToDouble operation to the Java platforms underlying default Stream implementation.static <T> IntStreammapMultiToInt(Stream<T> stream, BiConsumer<? super T, ? super IntConsumer> mapper) Delegates a Stream::mapMultiToInt operation to the Java platforms underlying default Stream implementation.static <T> LongStreammapMultiToLong(Stream<T> stream, BiConsumer<? super T, ? super LongConsumer> mapper) Delegates a Stream::mapMultiToLong operation to the Java platforms underlying default Stream implementation.static <T> List<T>Delegates a Stream::toList operation to the Java platforms underlying default Stream implementation.
-
Method Details
-
toList
Delegates a Stream::toList operation to the Java platforms underlying default Stream implementation. If run under Java 15 or prior, this method will throw an UnsupportedOperationException.- Type Parameters:
T- Element type in the Stream- Parameters:
stream- to apply the toList operation to- Returns:
- a List containing the stream elements
- Throws:
UnsupportedOperationException- if run under Java 15 or prior
-
mapMulti
public static <T,R> Stream<R> mapMulti(Stream<T> stream, BiConsumer<? super T, ? super Consumer<R>> mapper) Delegates a Stream::mapMulti operation to the Java platforms underlying default Stream implementation. If run under Java 15 or prior, this method will throw an UnsupportedOperationException.- Type Parameters:
T- The element type in the source StreamR- The element type of the new Stream- Parameters:
stream- to apply the mapMulti operation tomapper- a non-interfering, stateless function that generates replacement elements- Returns:
- the new Stream
- Throws:
UnsupportedOperationException- if run under Java 15 or prior
-
mapMultiToInt
public static <T> IntStream mapMultiToInt(Stream<T> stream, BiConsumer<? super T, ? super IntConsumer> mapper) Delegates a Stream::mapMultiToInt operation to the Java platforms underlying default Stream implementation. If run under Java 15 or prior, this method will throw an UnsupportedOperationException.- Type Parameters:
T- The element type in the source Stream- Parameters:
stream- to apply the mapMultiToInt operation tomapper- a non-interfering, stateless function that generates replacement elements- Returns:
- the new Stream
- Throws:
UnsupportedOperationException- if run under Java 15 or prior
-
mapMultiToDouble
public static <T> DoubleStream mapMultiToDouble(Stream<T> stream, BiConsumer<? super T, ? super DoubleConsumer> mapper) Delegates a Stream::mapMultiToDouble operation to the Java platforms underlying default Stream implementation. If run under Java 15 or prior, this method will throw an UnsupportedOperationException.- Type Parameters:
T- The element type in the source Stream- Parameters:
stream- to apply the mapMultiToDouble operation tomapper- a non-interfering, stateless function that generates replacement elements- Returns:
- the new Stream
- Throws:
UnsupportedOperationException- if run under Java 15 or prior
-
mapMultiToLong
public static <T> LongStream mapMultiToLong(Stream<T> stream, BiConsumer<? super T, ? super LongConsumer> mapper) Delegates a Stream::mapMultiToLong operation to the Java platforms underlying default Stream implementation. If run under Java 15 or prior, this method will throw an UnsupportedOperationException.- Type Parameters:
T- The element type in the source Stream- Parameters:
stream- to apply the mapMultiToLong operation tomapper- a non-interfering, stateless function that generates replacement elements- Returns:
- the new Stream
- Throws:
UnsupportedOperationException- if run under Java 15 or prior
-