/** * Returns a stream that provides the items of this stream that match the given {@code filter}. * * @param filter The filter to apply to the stream * @return A filtered version of this stream */ default DomainEventStream filter(Predicate<? super DomainEventMessage<?>> filter) { Objects.requireNonNull(filter); return new FilteringDomainEventStream(this, filter); }
/** * Returns a stream that provides the items of this stream that match the given {@code filter}. * * @param filter The filter to apply to the stream * @return A filtered version of this stream */ default DomainEventStream filter(Predicate<? super DomainEventMessage<?>> filter) { Objects.requireNonNull(filter); return new FilteringDomainEventStream(this, filter); }
/** * Returns a stream that provides the items of this stream that match the given {@code filter}. * * @param filter The filter to apply to the stream * @return A filtered version of this stream */ default DomainEventStream filter(Predicate<? super DomainEventMessage<?>> filter) { Objects.requireNonNull(filter); return new FilteringDomainEventStream(this, filter); }