|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.axonframework.domain.SimpleDomainEventStream
public class SimpleDomainEventStream
Creates a DomainEventStream that streams the contents of a list.
Constructor Summary | |
---|---|
SimpleDomainEventStream(Collection<? extends DomainEventMessage> events)
Initialize the event stream using the given List of DomainEvent and aggregate identifier. |
|
SimpleDomainEventStream(DomainEventMessage... events)
Initialize the event stream using the given DomainEventMessage s and aggregate identifier. |
Method Summary | |
---|---|
static DomainEventStream |
emptyStream()
Creates an empty stream. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleDomainEventStream(Collection<? extends DomainEventMessage> events)
events
- the list of domain events to stream
IllegalArgumentException
- if the given list is emptypublic SimpleDomainEventStream(DomainEventMessage... events)
DomainEventMessage
s and aggregate identifier. The aggregate
identifier is initialized by reading it from the first event available. Therefore, you must provide at least one
event.
events
- the list of domain events to stream
IllegalArgumentException
- if no events are suppliedMethod Detail |
---|
public 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()
hasNext
in interface DomainEventStream
true
if the stream contains more events.public 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 DomainEventStream.hasNext()
to confirm the existence of elements after the current pointer.
next
in interface DomainEventStream
NoSuchElementException
- when no items exist after the current pointer in the streampublic DomainEventMessage peek()
DomainEventStream.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 DomainEventStream
NoSuchElementException
- when no items exist after the current pointer in the streampublic static DomainEventStream emptyStream()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |