Class Java16StreamUtil

java.lang.Object
com.speedment.jpastreamer.javasixteen.Java16StreamUtil

public final class Java16StreamUtil extends Object
Author:
Per Minborg, Julia Gustafsson
  • Method Details

    • toList

      public static <T> List<T> toList(Stream<T> stream)
      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 Stream
      R - The element type of the new Stream
      Parameters:
      stream - to apply the mapMulti operation to
      mapper - 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 to
      mapper - 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 to
      mapper - 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 to
      mapper - a non-interfering, stateless function that generates replacement elements
      Returns:
      the new Stream
      Throws:
      UnsupportedOperationException - if run under Java 15 or prior