public interface DomainEventStream
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext()
Returns
true if the stream has more events, meaning that a call to next() will not
result in an exception. |
DomainEventMessage |
next()
Returns the next events in the stream, if available.
|
DomainEventMessage |
peek()
Returns the next events in the stream, if available, without moving the pointer forward.
|
boolean hasNext()
true
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()
true
if the stream contains more events.DomainEventMessage next()
hasNext()
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 hasNext()
to confirm the existence of elements after the current pointer.DomainEventMessage peek()
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 hasNext()
to confirm the existence of elements after the current pointer.Copyright © 2010-2014. All Rights Reserved.