AbstractThe command type
The result type
ProtectedvalidateValidates the command before handling. Override this method to add custom validation logic.
Success if valid, Failure with error if invalid
Protected AbstractexecuteMain handler logic. Override this method to implement the command handling.
The command to execute
Result with success value or domain error
Base class for command handlers with built-in validation and error handling.
Provides a template method pattern with hooks for validation and execution. Automatically handles Result types and throws on failure.
Example