/** * Returns a single element stream if this projection has a value, otherwise an empty stream. * * @return A single element stream if this projection has a value, otherwise an empty stream. */ public Stream<B> toStream() { return isRight() ? Stream.single(value()) : Stream.<B>nil(); }
/** * Returns a single element stream if this projection has a value, otherwise an empty stream. * * @return A single element stream if this projection has a value, otherwise an empty stream. */ public Stream<A> toStream() { return isLeft() ? Stream.single(value()) : Stream.<A>nil(); }