Class AbstractCommand

java.lang.Object
org.fuin.ddd4j.ddd.AbstractEvent
org.fuin.cqrs4j.AbstractCommand
All Implemented Interfaces:
Serializable, Command, org.fuin.ddd4j.ddd.Event
Direct Known Subclasses:
AbstractAggregateCommand

public abstract class AbstractCommand extends org.fuin.ddd4j.ddd.AbstractEvent implements Command
Base class for all commands.
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    protected static class 
    AbstractCommand.Builder<ID extends org.fuin.ddd4j.ddd.EntityId,TYPE extends AbstractCommand,BUILDER extends AbstractCommand.Builder<ID,TYPE,BUILDER>>
    Base class for event builders.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor.
    AbstractCommand(@NotNull org.fuin.ddd4j.ddd.Event respondTo)
    Constructor with event this one responds to.
    AbstractCommand(org.fuin.ddd4j.ddd.EventId correlationId, org.fuin.ddd4j.ddd.EventId causationId)
    Constructor with optional data.
  • Method Summary

    Methods inherited from class org.fuin.ddd4j.ddd.AbstractEvent

    equals, getCausationId, getCorrelationId, getEventId, getEventTimestamp, hashCode

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.fuin.ddd4j.ddd.Event

    getCausationId, getCorrelationId, getEventId, getEventTimestamp, getEventType
  • Constructor Details

    • AbstractCommand

      public AbstractCommand()
      Default constructor.
    • AbstractCommand

      public AbstractCommand(@NotNull @NotNull org.fuin.ddd4j.ddd.Event respondTo)
      Constructor with event this one responds to. Convenience method to set the correlation and causation identifiers correctly.
      Parameters:
      respondTo - Causing event.
    • AbstractCommand

      public AbstractCommand(@Nullable org.fuin.ddd4j.ddd.EventId correlationId, @Nullable org.fuin.ddd4j.ddd.EventId causationId)
      Constructor with optional data.
      Parameters:
      correlationId - Correlation ID.
      causationId - ID of the event that caused this one.