public interface Dispatcher extends CommandCallable
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsAlias(String alias)
Returns whether the dispatcher contains a registered command for the
given alias.
|
boolean |
containsMapping(CommandMapping mapping)
Returns whether the dispatcher contains the given mapping.
|
Optional<? extends CommandMapping> |
get(String alias)
Gets the
CommandMapping associated with an alias. |
Optional<? extends CommandMapping> |
get(String alias,
CommandSource source)
Gets the
CommandMapping associated with an alias in the context
of a given CommandSource. |
Set<String> |
getAliases()
Gets a list of all the command aliases, which includes the primary alias.
|
Multimap<String,CommandMapping> |
getAll()
Gets all commands currently registered with this dispatcher.
|
Set<? extends CommandMapping> |
getAll(String alias)
Gets all the
CommandMappings associated with an alias. |
Set<? extends CommandMapping> |
getCommands()
Gets a list of commands.
|
Set<String> |
getPrimaryAliases()
Gets a list of primary aliases.
|
getHelp, getShortDescription, getSuggestions, getUsage, process, testPermissionSet<? extends CommandMapping> getCommands()
The returned collection cannot be modified.
Set<String> getPrimaryAliases()
The returned collection cannot be modified.
Set<String> getAliases()
A command may have more than one alias assigned to it. The returned collection cannot be modified.
Optional<? extends CommandMapping> get(String alias)
CommandMapping associated with an alias. Returns null if
no command is named by the given alias.alias - The aliasOptional<? extends CommandMapping> get(String alias, @Nullable CommandSource source)
CommandMapping associated with an alias in the context
of a given CommandSource. Returns null if no command is named by
the given alias.alias - The alias to look upsource - The source this alias is being looked up forSet<? extends CommandMapping> getAll(String alias)
CommandMappings associated with an alias.alias - The aliasMultimap<String,CommandMapping> getAll()
boolean containsAlias(String alias)
alias - The aliasboolean containsMapping(CommandMapping mapping)
mapping - The mapping