Interface CommandContext<T>

    • Method Detail

      • commandName

        java.lang.String commandName()
        The name of the command being executed.
        Returns:
        The name of the command.
      • commandId

        long commandId()
        The id of the command being executed.
        Returns:
        The id of the command.
      • getState

        java.util.Optional<T> getState()
        Retrieve the state.
        Returns:
        the current state or empty if none have been created.
        Throws:
        java.lang.IllegalStateException - If the current entity state have been deleted in the command invocation.
      • updateState

        void updateState​(T state)
        Update the entity with the new state. The state will be persisted.
        Parameters:
        state - The state to persist.
      • deleteState

        void deleteState()
        Delete the entity state.