Class Command<C>

java.lang.Object
org.incendo.cloud.Command<C>
Type Parameters:
C - command sender type

@API(status=STABLE) public class Command<C> extends Object
A command is a chain of command components with an associated commandExecutionHandler().

The recommended way of creating a command is by using a command builder. You may either create the command builder using newBuilder(String, CommandMeta, String...) or CommandBuilderSource.commandBuilder(String, String...). Getting a builder from the command manager means that the builder is linked to the manager. When the command builder is linked to the manager, it is able to retrieve parsers from the associated ParserRegistry in the case that only a parsed type is given to the builder, and not a complete parser. You may link any command builder to a command manager by using Command.Builder.manager(CommandManager).

All command flags added to a command builder will be collected into a single component. If there are flags added to the command, then they may be retrieved from the flagComponent() or from the flagParser().

Commands may have meta-data associated with them, which can be accessed using commandMeta(). A common way of using the command meta is by using it to filter out commands in post-processing.

A command may have a senderType() that is different from the sender type of the command manager. The command tree will enforce this type when parsing the command.