|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.axonframework.domain.SimpleDomainEventStream
public class SimpleDomainEventStream
Creates a DomainEventStream that streams the contents of a list.
| Constructor Summary | |
|---|---|
SimpleDomainEventStream(DomainEvent... events)
Initialize the event stream using the given DomainEvents and aggregate
identifier. |
|
SimpleDomainEventStream(List<? extends DomainEvent> events)
Initialize the event stream using the given List of DomainEvent and aggregate identifier. |
|
| Method Summary | |
|---|---|
boolean |
hasNext()
Returns true if the stream has more events, meaning that a call to next() will not
result in an exception. |
DomainEvent |
next()
Returns the next events in the stream, if available. |
DomainEvent |
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(List<? extends DomainEvent> events)
events - the list of domain events to stream
IllegalArgumentException - if the given list is emptypublic SimpleDomainEventStream(DomainEvent... events)
DomainEvents 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 supplied| Method 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 DomainEventStreamtrue if the stream contains more events.public DomainEvent 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 DomainEventStreamNoSuchElementException - when no items exist after the current pointer in the streampublic DomainEvent 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 DomainEventStreamNoSuchElementException - when no items exist after the current pointer in the stream
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||