java.lang.Object
org.fuin.ddd4j.jsonb.AbstractEvent
- All Implemented Interfaces:
Serializable,org.fuin.ddd4j.core.Event
- Direct Known Subclasses:
AbstractDomainEvent
Base class for events. Equals and hash code are solely based on the event id.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classAbstractEvent.Builder<TYPE extends AbstractEvent,BUILDER extends AbstractEvent.Builder<TYPE, BUILDER>> Base class for event builders. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.AbstractEvent(@NotNull org.fuin.ddd4j.core.Event respondTo) Constructor with event this one responds to.AbstractEvent(org.fuin.ddd4j.core.EventId correlationId, org.fuin.ddd4j.core.EventId causationId) Constructor with optional data. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanfinal org.fuin.ddd4j.core.EventIdfinal org.fuin.ddd4j.core.EventIdfinal org.fuin.ddd4j.core.EventIdfinal ZonedDateTimefinal inthashCode()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.fuin.ddd4j.core.Event
getEventType
-
Constructor Details
-
AbstractEvent
public AbstractEvent()Default constructor. -
AbstractEvent
public AbstractEvent(@NotNull @NotNull org.fuin.ddd4j.core.Event respondTo) Constructor with event this one responds to. Convenience method to set the correlation and causation identifiers correctly.- Parameters:
respondTo- Causing event.
-
AbstractEvent
public AbstractEvent(@Nullable org.fuin.ddd4j.core.EventId correlationId, @Nullable org.fuin.ddd4j.core.EventId causationId) Constructor with optional data.- Parameters:
correlationId- Correlation ID.causationId- ID of the event that caused this one.
-
-
Method Details
-
getEventId
public final org.fuin.ddd4j.core.EventId getEventId()- Specified by:
getEventIdin interfaceorg.fuin.ddd4j.core.Event
-
getEventTimestamp
- Specified by:
getEventTimestampin interfaceorg.fuin.ddd4j.core.Event
-
getCorrelationId
public final org.fuin.ddd4j.core.EventId getCorrelationId()- Specified by:
getCorrelationIdin interfaceorg.fuin.ddd4j.core.Event
-
getCausationId
public final org.fuin.ddd4j.core.EventId getCausationId()- Specified by:
getCausationIdin interfaceorg.fuin.ddd4j.core.Event
-
hashCode
public final int hashCode() -
equals
-