Package com.ultikits.ultitools.abstracts.command
package com.ultikits.ultitools.abstracts.command
New command handling framework with improved architecture.
This package provides a refactored command system using:
- Chain of Responsibility Pattern - for command validation pipeline
- Strategy Pattern - for type parsing
- Context Object Pattern - for command execution context
Key Components:
CommandContext- Immutable command execution contextBaseCommandExecutor- New base command executorTypeParserRegistry- Type parser registryValidatorChain- Validation pipeline
Migration from the removed AbstractCommandExecutor:
AbstractCommandExecutor (and its misspelled shim, AbstractCommendExecutor) was
removed in 6.3.0 after its 6.2.1 deprecation window closed. See the
6.x migration guide for AbstractCommandExecutor
for the base-class swap shown below and the other 6.3.0 migration steps. Before rebuilding
against 7.0, also follow the
Command engine (as of 7.0.0)
section of COMPATIBILITY.md on main.
// Old way (removed in 6.3.0)
public class MyCommand extends AbstractCommandExecutor {
@Override
protected void handleHelp(CommandSender sender) { }
}
// New way
public class MyCommand extends BaseCommandExecutor {
@Override
protected void handleHelp(CommandSender sender) { }
}
Benefits of new architecture:
- Better separation of concerns
- Extensible validation pipeline
- Type-safe parameter parsing
- Easier unit testing
- Reduced code duplication
- Since:
- 6.2.0
-
ClassDescriptionBase command executor with improved architecture using Chain of Responsibility pattern.Immutable command execution context containing all information about a command invocation.Framework-owned command feedback; rendered only when its recipient is known.Framework services for executors constructed outside the root container.A drain's remaining allowance; only time spent waiting for command bodies is charged.Framework-internal access to the config-bound
@CmdCDstate an executor carries (#531): the resolved seconds of its bound cooldowns and their load-time value sources, both keyed byCooldownValidator.bindingKey.