util/stream_util library

Classes

SplitStreams<K, E>
Splits a stream into multiple streams based on the classification function. The streams are closed when the last element in the source stream is emitted. If the source stream ends with an error, it is propagated to all streams not yet closed.

Functions

withFallback<T>(Stream<T> stream, T fallbackElement) Stream<T>
Returns a stream that emits the events from the given stream, or the fallback element if the stream is empty.