Class ValueEntity<S>

  • Type Parameters:
    S - The type of the state for this entity.

    public abstract class ValueEntity<S>
    extends Object
    • Constructor Detail

      • ValueEntity

        public ValueEntity()
    • Method Detail

      • emptyState

        public abstract S emptyState()
        Implement by returning the initial empty state object. This object will be passed into the command handlers, until a new state replaces it.

        Also known as "zero state" or "neutral state".

        null is an allowed value.

      • commandContext

        protected CommandContext commandContext()
        Additional context and metadata for a command handler.

        It will throw an exception if accessed from constructor.

      • _internalSetCommandContext

        public void _internalSetCommandContext​(java.util.Optional<CommandContext> context)