|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.axonframework.domain.EventBase
org.axonframework.domain.DomainEvent
public abstract class DomainEvent
Base class for all Domain Events. This class contains the basic behavior expected from any event to be processed by event sourcing engines and aggregates.
| Constructor Summary | |
|---|---|
protected |
DomainEvent()
Initialize the domain event. |
protected |
DomainEvent(long sequenceNumber,
AggregateIdentifier aggregateIdentifier)
Initialize the domain event. |
| Method Summary | |
|---|---|
boolean |
equals(Object o)
Checks for equality of two events. |
AggregateIdentifier |
getAggregateIdentifier()
Returns the identifier of the aggregate that reported this event. |
Long |
getAggregateVersion()
Returns the version number of the aggregate generating this event. |
Long |
getSequenceNumber()
Returns the sequence number of this event, if available. |
int |
hashCode()
|
| Methods inherited from class org.axonframework.domain.EventBase |
|---|
addMetaData, getEventIdentifier, getEventRevision, getMetaData, getMetaDataValue, getTimestamp, setEventRevision |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected DomainEvent()
AbstractEventSourcedAggregateRoot.apply(DomainEvent)
method. The sequenceNumber and aggregateIdentifier are automatically set to the correct
values for that aggregate.
If you do not use the AbstractEventSourcedAggregateRoot.apply(DomainEvent)
method, but need the sequenceNumber and aggregateIdentifier to be set to specific
values, use the DomainEvent(long, AggregateIdentifier) constructor.
protected DomainEvent(long sequenceNumber,
AggregateIdentifier aggregateIdentifier)
sequenceNumber and aggregateIdentifier to be set to
specific values.
Two use cases for this constructor aresetAggregateIdentifier(AggregateIdentifier)
and setSequenceNumber(long) will result in an exception.
sequenceNumber - The sequence number to assign to this eventaggregateIdentifier - The identifier of the aggregate this event applies to| Method Detail |
|---|
public Long getSequenceNumber()
EventContainer.
public Long getAggregateVersion()
getSequenceNumber() and is solely provided to provide a clear meaning to the returned value.
public AggregateIdentifier getAggregateIdentifier()
public boolean equals(Object o)
equals in class EventBaseo - the other DomainEvent
public int hashCode()
hashCode in class EventBase
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||