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 Details

    • 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 for getAggregateVersion().asBaseType()-
      Returns:
      Expected version or null.