public class FilteringDomainEventStream extends Object implements DomainEventStream
| Constructor and Description |
|---|
FilteringDomainEventStream(DomainEventStream delegate,
Predicate<? super org.axonframework.eventhandling.DomainEventMessage<?>> filter)
Initialize the stream, filter the given
stream with the given
filter. |
| Modifier and Type | Method and Description |
|---|---|
Long |
getLastSequenceNumber()
Get the highest known sequence number in the upstream event entry stream.
|
boolean |
hasNext()
Returns
true if the stream has more events, meaning that a call to next() will not
result in an exception. |
org.axonframework.eventhandling.DomainEventMessage<?> |
next()
Returns the next events in the stream, if available.
|
org.axonframework.eventhandling.DomainEventMessage<?> |
peek()
Returns the next events in the stream, if available, without moving the pointer forward.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitasStream, concat, empty, filter, of, of, of, of, of, removeforEachRemainingpublic FilteringDomainEventStream(DomainEventStream delegate, Predicate<? super org.axonframework.eventhandling.DomainEventMessage<?>> filter)
stream with the given
filter.delegate - The stream providing the elementsfilter - The filter to apply to the delegate streampublic org.axonframework.eventhandling.DomainEventMessage<?> peek()
DomainEventStreamDomainEventStream.next() will return the same event as a call to peek(). Use hasNext() to obtain a
guarantee about the availability of any next event.
If the pointer has reached the end of the stream, the behavior of this method is undefined. It could either
return null, or throw an exception, depending on the actual implementation. Use DomainEventStream.hasNext()
to confirm the existence of elements after the current pointer.peek in interface DomainEventStreampublic boolean hasNext()
DomainEventStreamtrue if the stream has more events, meaning that a call to next() will not
result in an exception. If a call to this method returns false, there is no guarantee about the
result of a consecutive call to next()hasNext in interface Iterator<org.axonframework.eventhandling.DomainEventMessage<?>>hasNext in interface DomainEventStreamtrue if the stream contains more events.public org.axonframework.eventhandling.DomainEventMessage<?> next()
DomainEventStreamhasNext() to obtain a guarantee about the
availability of any next event. Each call to next() will forward the pointer to the next event in
the stream.
If the pointer has reached the end of the stream, the behavior of this method is undefined. It could either
return null, or throw an exception, depending on the actual implementation. Use DomainEventStream.hasNext()
to confirm the existence of elements after the current pointer.next in interface Iterator<org.axonframework.eventhandling.DomainEventMessage<?>>next in interface DomainEventStreampublic Long getLastSequenceNumber()
DomainEventStreamTo get the highest absolute sequence number of the underlying event entry stream make sure to iterate over all elements in the stream before calling this method.
If the stream is empty this method returns null.
getLastSequenceNumber in interface DomainEventStreamCopyright © 2010–2024. All rights reserved.