/** * Returns this DomainEventStream as a {@link Stream} of DomainEventMessages. Note that the returned Stream will * start at the current position of the DomainEventStream. * <p> * Note that iterating over the returned Stream may affect this DomainEventStream and vice versa. It is therefore * not recommended to use this DomainEventStream after invoking this method. * * @return This DomainEventStream as a Stream of event messages */ default Stream<? extends DomainEventMessage<?>> asStream() { return EventStreamUtils.asStream(this); }
/** * Returns this DomainEventStream as a {@link Stream} of DomainEventMessages. Note that the returned Stream will * start at the current position of the DomainEventStream. * <p> * Note that iterating over the returned Stream may affect this DomainEventStream and vice versa. It is therefore * not recommended to use this DomainEventStream after invoking this method. * * @return This DomainEventStream as a Stream of event messages */ default Stream<? extends DomainEventMessage<?>> asStream() { return EventStreamUtils.asStream(this); }