Package org.fuin.ddd4j.ddd
Interface DomainEvent<ID extends EntityId>
-
- Type Parameters:
ID- Type of the identifier.
- All Superinterfaces:
Event,Serializable
- All Known Implementing Classes:
AbstractDomainEvent
public interface DomainEvent<ID extends EntityId> extends Event
Domain event published by an entity.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AggregateVersiongetAggregateVersion()Returns the version of the aggregate the entity belongs to.IntegergetAggregateVersionInteger()Returns the aggregate version as integer.IDgetEntityId()Returns the identifier of the entity that caused this event.@NotNull EntityIdPathgetEntityIdPath()Returns the path to the originator of the event.-
Methods inherited from interface org.fuin.ddd4j.ddd.Event
getCausationId, getCorrelationId, getEventId, getEventTimestamp, getEventType
-
-
-
-
Method Detail
-
getEntityIdPath
@NotNull @NotNull EntityIdPath getEntityIdPath()
Returns the path to the originator of the event.- Returns:
- List of unique identifiers from aggregate root to the entity that emitted the event.
-
getEntityId
@NotNull ID getEntityId()
Returns the identifier of the entity that caused this event. This is the last ID in the path.- Returns:
- Entity identifier.
-
getAggregateVersion
@Nullable AggregateVersion getAggregateVersion()
Returns the version of the aggregate the entity belongs to.- Returns:
- Aggregate version at the time the event was raised.
-
getAggregateVersionInteger
@Nullable Integer getAggregateVersionInteger()
Returns the aggregate version as integer. This is a null-safe shortcut forgetAggregateVersion().asBaseType()-- Returns:
- Expected version or null.
-
-