Class CommandBean<C>

java.lang.Object
org.incendo.cloud.bean.CommandBean<C>
Type Parameters:
C - the command sender type
All Implemented Interfaces:
CommandFactory<C>, CommandExecutionHandler<C>

@API(status=STABLE) public abstract class CommandBean<C> extends Object implements CommandExecutionHandler<C>, CommandFactory<C>
An alternative way of registering commands, where each command lives in a separate class.

The command bean is a CommandExecutionHandler and will be set as the handler of the command by default. The execute(CommandContext) or CommandExecutionHandler.executeFuture(CommandContext) methods can be overridden to implement your command handler. You may also provide custom handler when configure(Command.Builder) is invoked.

Information about the command, such as aliases, should be provided by properties(). The command bean may be registered to the command manager by using CommandManager.command(CommandFactory). This will invoke configure(Command.Builder) where you may configure the command. The command meta may be configured by overriding meta().