java.lang.Object
it.tidalwave.util.StreamUtils
A collection of operations on
Streams.- Since:
- 3.2-ALPHA-12
- Author:
- Fabrizio Giudici
- Status: draft API
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stream<LocalDateTime> randomLocalDateTimeStream(long seed, LocalDateTime from, LocalDateTime to) Returns aStreamof randomLocalDateTimes, in the given range.Zips two streams.static <A,B, R> Stream <R> zip(Stream<? extends A> streamA, Stream<? extends B> streamB, BiFunction<? super A, ? super B, ? extends R> zipper) Zips two streams.
-
Constructor Details
-
StreamUtils
public StreamUtils()
-
-
Method Details
-
zip
@Nonnull public static <A,B> Stream<Pair<A,B>> zip(@Nonnull Stream<? extends A> streamA, @Nonnull Stream<? extends B> streamB) Zips two streams. -
zip
@Nonnull public static <A,B, Stream<R> zipR> (@Nonnull Stream<? extends A> streamA, @Nonnull Stream<? extends B> streamB, @Nonnull 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
- See Also:
-
randomLocalDateTimeStream
@Nonnull public static Stream<LocalDateTime> randomLocalDateTimeStream(long seed, @Nonnull LocalDateTime from, @Nonnull LocalDateTime to) Returns aStreamof randomLocalDateTimes, in the given range. The used random generator is not strong enough for cryptographic purposes.- Parameters:
seed- the random seedfrom- the lower bound of the range (included)to- the upper bound of the range (excluded)- Returns:
- the stream
- Since:
- 3.2-ALPHA-19
-