Class AbstractDomainEvent<ID extends org.fuin.ddd4j.core.EntityId>

java.lang.Object
org.fuin.ddd4j.jackson.AbstractEvent
org.fuin.ddd4j.jackson.AbstractDomainEvent<ID>
Type Parameters:
ID - Type of the entity identifier.
All Implemented Interfaces:
Serializable, org.fuin.ddd4j.core.DomainEvent<ID>, org.fuin.ddd4j.core.Event

public abstract class AbstractDomainEvent<ID extends org.fuin.ddd4j.core.EntityId> extends AbstractEvent implements org.fuin.ddd4j.core.DomainEvent<ID>
Base class for domain events.
See Also:
  • Constructor Details

    • AbstractDomainEvent

      protected AbstractDomainEvent()
      Protected default constructor for deserialization.
    • AbstractDomainEvent

      public AbstractDomainEvent(@NotNull @NotNull org.fuin.ddd4j.core.EntityIdPath entityIdPath)
      Constructor with entity identifier path.
      Parameters:
      entityIdPath - Identifier path from aggregate root to the entity that emitted the event.
    • AbstractDomainEvent

      public AbstractDomainEvent(@NotNull @NotNull org.fuin.ddd4j.core.EntityIdPath entityIdPath, @NotNull @NotNull org.fuin.ddd4j.core.Event respondTo)
      Constructor with entity identifier path and event this one responds to. Convenience method to set the correlation and causation identifiers correctly.
      Parameters:
      entityIdPath - Identifier path from aggregate root to the entity that emitted the event.
      respondTo - Causing event.
    • AbstractDomainEvent

      public AbstractDomainEvent(@NotNull @NotNull org.fuin.ddd4j.core.EntityIdPath entityIdPath, @Nullable org.fuin.ddd4j.core.EventId correlationId, @Nullable org.fuin.ddd4j.core.EventId causationId)
      Constructor with entity identifier path, correlation and causation identifiers.
      Parameters:
      entityIdPath - Identifier path from aggregate root to the entity that emitted the event.
      correlationId - Correlation ID.
      causationId - ID of the event that caused this one.
  • Method Details

    • getEntityIdPath

      public final org.fuin.ddd4j.core.EntityIdPath getEntityIdPath()
      Specified by:
      getEntityIdPath in interface org.fuin.ddd4j.core.DomainEvent<ID extends org.fuin.ddd4j.core.EntityId>
    • getEntityId

      public final ID getEntityId()
      Specified by:
      getEntityId in interface org.fuin.ddd4j.core.DomainEvent<ID extends org.fuin.ddd4j.core.EntityId>
    • getAggregateVersion

      @Nullable public final org.fuin.ddd4j.core.AggregateVersion getAggregateVersion()
      Specified by:
      getAggregateVersion in interface org.fuin.ddd4j.core.DomainEvent<ID extends org.fuin.ddd4j.core.EntityId>
    • getAggregateVersionInteger

      @Nullable public final Integer getAggregateVersionInteger()
      Specified by:
      getAggregateVersionInteger in interface org.fuin.ddd4j.core.DomainEvent<ID extends org.fuin.ddd4j.core.EntityId>