Class CommandExecution<S>
java.lang.Object
dev.ua.theroer.magicutils.commands.CommandExecution<S>
- Type Parameters:
S- sender type
Execution context for runtime-defined command actions.
-
Method Summary
Modifier and TypeMethodDescriptionarg(int index) Returns the parsed argument at the index.<T> TReturns the parsed argument at the index with type checking.Returns the parsed argument by name.<T> TReturns the parsed argument by name with type checking.Returns argument descriptors as an immutable list.command()Returns the command instance.Returns the root command name.booleanReturns true if an argument value exists by name.Object[]Returns parsed arguments.rawArgs()Returns raw arguments as an immutable list.sender()Returns the sender instance.Returns the subcommand name if present.toString()
-
Method Details
-
command
-
commandName
-
subCommandName
Returns the subcommand name if present.- Returns:
- subcommand path (space-separated) or null
-
sender
-
rawArgs
-
arguments
Returns argument descriptors as an immutable list.- Returns:
- argument descriptors
-
parsedArgs
-
arg
Returns the parsed argument at the index.- Parameters:
index- argument index- Returns:
- argument value or null
-
arg
Returns the parsed argument at the index with type checking.- Type Parameters:
T- type parameter- Parameters:
index- argument indextype- expected type- Returns:
- typed value or null
-
arg
-
arg
-
hasArg
Returns true if an argument value exists by name.- Parameters:
name- argument name- Returns:
- true if argument is present
-
toString
-