|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DomainEventStream
The DomainEventStream represents a stream of historical domain events. The order of events in this stream must represent the actual chronological order in which the events happened. A DomainEventStream may provide access to all events (from the first to the most recent) or any subset of these.
Method Summary | |
---|---|
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. |
Method Detail |
---|
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |