Module org.fuin.ddd4j.jackson
Package org.fuin.ddd4j.jackson
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classAbstractDomainEvent.Builder<ID extends org.fuin.ddd4j.core.EntityId,TYPE extends AbstractDomainEvent<ID>, BUILDER extends AbstractDomainEvent.Builder<ID, TYPE, BUILDER>> Base class for event builders. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedProtected default constructor for deserialization.AbstractDomainEvent(@NotNull org.fuin.ddd4j.core.EntityIdPath entityIdPath) Constructor with entity identifier path.AbstractDomainEvent(@NotNull org.fuin.ddd4j.core.EntityIdPath entityIdPath, @NotNull org.fuin.ddd4j.core.Event respondTo) Constructor with entity identifier path and event this one responds to.AbstractDomainEvent(@NotNull org.fuin.ddd4j.core.EntityIdPath entityIdPath, org.fuin.ddd4j.core.EventId correlationId, org.fuin.ddd4j.core.EventId causationId) Constructor with entity identifier path, correlation and causation identifiers. -
Method Summary
Methods inherited from class org.fuin.ddd4j.jackson.AbstractEvent
equals, getCausationId, getCorrelationId, getEventId, getEventTimestamp, hashCodeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.fuin.ddd4j.core.Event
getCausationId, getCorrelationId, getEventId, getEventTimestamp, getEventType
-
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:
getEntityIdPathin interfaceorg.fuin.ddd4j.core.DomainEvent<ID extends org.fuin.ddd4j.core.EntityId>
-
getEntityId
- Specified by:
getEntityIdin interfaceorg.fuin.ddd4j.core.DomainEvent<ID extends org.fuin.ddd4j.core.EntityId>
-
getAggregateVersion
@Nullable public final org.fuin.ddd4j.core.AggregateVersion getAggregateVersion()- Specified by:
getAggregateVersionin interfaceorg.fuin.ddd4j.core.DomainEvent<ID extends org.fuin.ddd4j.core.EntityId>
-
getAggregateVersionInteger
- Specified by:
getAggregateVersionIntegerin interfaceorg.fuin.ddd4j.core.DomainEvent<ID extends org.fuin.ddd4j.core.EntityId>
-