public class Streams
extends java.lang.Object
Stream instances.| Constructor and Description |
|---|
Streams() |
| Modifier and Type | Method and Description |
|---|---|
static <T,R> java.util.stream.Stream<R> |
mapWithIndex(java.util.stream.Stream<T> stream,
java.util.function.BiFunction<? super T,java.lang.Long,? extends R> function)
Returns a stream consisting of the results of applying the given function to the elements of
stream and their indices in the stream. |
public static <T,R> java.util.stream.Stream<R> mapWithIndex(java.util.stream.Stream<T> stream,
java.util.function.BiFunction<? super T,java.lang.Long,? extends R> function)
stream and their indices in the stream.
Copied from Guava 27.0.1-jre com.google.common.collect.StreamsT - input typeR - output typestream - input streamfunction - mapping function with index as long