Class NonEmptyStream<T>

java.lang.Object
no.digipost.stream.NonEmptyStream<T>
Type Parameters:
T - the type of the stream elements
All Implemented Interfaces:
AutoCloseable, BaseStream<T,Stream<T>>, Stream<T>

public class NonEmptyStream<T> extends Object implements Stream<T>
A stream which is guarantied to produce at least one element. It provides some extensions to the general Stream API for processing the stream knowing it is non-empty, including, but not limited to: A selection of operations which maintains the cardinality of the stream returns NonEmptyStream, such as: This selection may be extended in the future. For operations which can not guarantie the result will still be a non-empty stream, such as filter and limit, will yield a regular Stream.