Class MagicCommand.Builder<S>
java.lang.Object
dev.ua.theroer.magicutils.commands.MagicCommand.Builder<S>
- Type Parameters:
S- sender type
- Enclosing class:
MagicCommand
Builder API that produces a concrete
MagicCommand.-
Method Summary
Modifier and TypeMethodDescriptionSets the command aliases.argument(CommandArgument argument) Adds a command argument.arguments(List<CommandArgument> arguments) Sets the list of command arguments.build()Builds the MagicCommand instance.Builds the command specification.description(String description) Sets the command description.execute(CommandExecutor<S> executor) Sets the command executor.mount(MagicCommand command) Mounts another MagicCommand to this command.mount(String route, MagicCommand command) Mounts another MagicCommand to a specific sub-path.permission(String permission) Sets the required permission node.permissionDefault(MagicPermissionDefault permissionDefault) Sets the default permission state.subCommand(SubCommandSpec<S> subCommand) Adds a subcommand.threading(CommandThreading threading) Sets the execution threading mode.
-
Method Details
-
description
Sets the command description.- Parameters:
description- description text- Returns:
- this builder
-
aliases
Sets the command aliases.- Parameters:
aliases- list of aliases- Returns:
- this builder
-
permission
Sets the required permission node.- Parameters:
permission- permission node- Returns:
- this builder
-
permissionDefault
Sets the default permission state.- Parameters:
permissionDefault- default permission- Returns:
- this builder
-
threading
Sets the execution threading mode.- Parameters:
threading- execution threading mode- Returns:
- this builder
-
argument
Adds a command argument.- Parameters:
argument- command argument- Returns:
- this builder
-
arguments
Sets the list of command arguments.- Parameters:
arguments- list of arguments- Returns:
- this builder
-
execute
Sets the command executor.- Parameters:
executor- command executor- Returns:
- this builder
-
subCommand
Adds a subcommand.- Parameters:
subCommand- subcommand specification- Returns:
- this builder
-
mount
Mounts another MagicCommand to this command.- Parameters:
command- command to mount- Returns:
- this builder
-
mount
Mounts another MagicCommand to a specific sub-path.- Parameters:
route- sub-path routecommand- command to mount- Returns:
- this builder
-
buildSpec
-
build
-