public interface Dispatcher extends CommandCallable
Modifier and Type | Method and Description |
---|---|
boolean |
contains(java.lang.String alias)
Returns whether the dispatcher contains a registered command for the given alias.
|
CommandMapping |
get(java.lang.String alias)
Get the
CommandCallable associated with an alias. |
java.util.Collection<java.lang.String> |
getAliases()
Get a list of all the command aliases, which includes the primary alias.
|
java.util.Set<CommandMapping> |
getCommands()
Get a list of commands.
|
java.util.Collection<java.lang.String> |
getPrimaryAliases()
Get a list of primary aliases.
|
void |
registerCommand(CommandCallable callable,
java.lang.String... alias)
Register a command with this dispatcher.
|
call, getDescription, testPermission
getSuggestions
void registerCommand(CommandCallable callable, java.lang.String... alias)
callable
- the command executoralias
- a list of aliases, where the first alias is the primary namejava.util.Set<CommandMapping> getCommands()
The returned collection cannot be modified.
java.util.Collection<java.lang.String> getPrimaryAliases()
The returned collection cannot be modified.
java.util.Collection<java.lang.String> getAliases()
A command may have more than one alias assigned to it. The returned collection cannot be modified.
@Nullable CommandMapping get(java.lang.String alias)
CommandCallable
associated with an alias. Returns
null if no command is named by the given alias.alias
- the aliasboolean contains(java.lang.String alias)
alias
- the alias