Package it.tidalwave.util
Class StreamOperations
- java.lang.Object
-
- it.tidalwave.util.StreamOperations
-
public final class StreamOperations extends java.lang.ObjectA collection of operations onStreams.- Since:
- 3.2-ALPHA-12
- Author:
- Fabrizio Giudici
- Status: draft API
-
-
Constructor Summary
Constructors Constructor Description StreamOperations()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <A,B>
java.util.stream.Stream<Pair<A,B>>zip(java.util.stream.Stream<? extends A> streamA, java.util.stream.Stream<? extends B> streamB)Zips two streams into a stream ofPairs.static <A,B,R>
java.util.stream.Stream<R>zip(java.util.stream.Stream<A> streamA, java.util.stream.Stream<B> streamB, java.util.function.BiFunction<? super A,? super B,? extends R> zipper)Zips two streams.
-
-
-
Method Detail
-
zip
@Nonnull public static <A,B> java.util.stream.Stream<Pair<A,B>> zip(@Nonnull java.util.stream.Stream<? extends A> streamA, @Nonnull java.util.stream.Stream<? extends B> streamB)
Zips two streams into a stream ofPairs.- Type Parameters:
A- the type of elements of the firstStreamB- the type of elements of the secondStream- Parameters:
streamA- the firstStreamstreamB- the secondStream- Returns:
- the zipped
Stream - Since:
- 3.2-ALPHA-12
-
zip
@Nonnull public static <A,B,R> java.util.stream.Stream<R> zip(@Nonnull java.util.stream.Stream<A> streamA, @Nonnull java.util.stream.Stream<B> streamB, @Nonnull java.util.function.BiFunction<? super A,? super B,? extends R> zipper)Zips two streams.- Type Parameters:
A- the type of elements of the firstStreamB- the type of elements of the secondStreamR- the type of elements of the zippedStream- Parameters:
streamA- the firstStreamstreamB- the secondStreamzipper- the zipping function- Returns:
- the zipped
Stream - Since:
- 3.2-ALPHA-12
-
-