Class CommandMeta
java.lang.Object
de.eldoria.eldoutilities.commands.command.CommandMeta
-
Constructor Summary
ConstructorDescriptionCommandMeta
(String name, String[] aliases, Set<String> permissions, Set<Class<? extends CommandSender>> allowedSender, List<Argument> arguments, AdvancedCommand defaultCommand, Map<String, AdvancedCommand> subCommands, AdvancedCommand parent, boolean hidden) -
Method Summary
Modifier and TypeMethodDescriptionString[]
aliases()
Set<Class<? extends CommandSender>>
Set of command senders which are allowed to use this commandOrdered list of arguments.static CommandMetaBuilder
Create a command call route based on this command.forSubCommand
(String name, AdvancedCommand parent) Creates a meta for a internal subcommand.boolean
boolean
isHidden()
name()
Get the name of the commandparent()
protected void
parent
(AdvancedCommand parent) A set of permissions, which may be required for this command.int
-
Constructor Details
-
CommandMeta
public CommandMeta(String name, String[] aliases, Set<String> permissions, Set<Class<? extends CommandSender>> allowedSender, List<Argument> arguments, AdvancedCommand defaultCommand, Map<String, AdvancedCommand> subCommands, AdvancedCommand parent, boolean hidden)
-
-
Method Details
-
builder
-
createCommandCall
Create a command call route based on this command.This method traced back to the parent commands until the end is reached.
- Returns:
- a string containing all commands of the route in the correct order.
-
name
Get the name of the command- Returns:
- name of command
-
permissions
A set of permissions, which may be required for this command.- Returns:
- set of permissions
-
allowedSender
Set of command senders which are allowed to use this command- Returns:
- set of command senders
-
arguments
Ordered list of arguments. The list is ordered by creation order.- Returns:
- list of arguments
-
defaultCommand
-
subCommands
-
registeredCommands
-
requiredArguments
public int requiredArguments() -
argumentString
-
parent
-
parent
-
isCommand
-
forSubCommand
Creates a meta for a internal subcommand. This is for small commands only and has several caveats.Only set arguments on this builder. Everything else wont have any effect.
- Parameters:
name
- name of internal subcommandparent
- parent command which contains this subcommand- Returns:
- a builder which allows to add arguments.
-
aliases
-
isHidden
public boolean isHidden()
-