Interface DomainEvent

All Superinterfaces:
DomainObject<DomainEvent>, Serializable
All Known Implementing Classes:
AbstractDomainEvent

public interface DomainEvent extends DomainObject<DomainEvent>, Serializable
A domain-driven design domain event, i.e., something that happened that domain experts care about.
Author:
RealLifeDeveloper
  • Method Summary

    Modifier and Type
    Method
    Description
    Gives the time the event occurred.
    int
    Gives the version of this event.
  • Method Details

    • eventOccurredOn

      ZonedDateTime eventOccurredOn()
      Gives the time the event occurred.
      Returns:
      the time the event occurred
    • eventVersion

      int eventVersion()
      Gives the version of this event. This is useful when deserializing an event.

      The version should start at 1 and be incremented each time the event class is updated in a way that affects serialization/deserialization.

      Returns:
      the version of this event