Class CommandSpec.Builder<S>
java.lang.Object
dev.ua.theroer.magicutils.commands.CommandSpec.Builder<S>
- Type Parameters:
S- sender type
- Enclosing class:
CommandSpec<S>
Builder for compatibility command specifications.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds command aliases.argument(CommandArgument argument) Adds a single argument.arguments(List<CommandArgument> arguments) Adds multiple arguments.build()Builds the immutable command spec.description(String description) Sets the command description.execute(CommandExecutor<S> executor) Sets the execution handler.mergePolicy(MergePolicy mergePolicy) Sets how this command's root execute is owned when merged into a shared root.permission(String permission) Sets explicit permission node.permissionDefault(MagicPermissionDefault permissionDefault) Sets the default permission value.subCommand(SubCommandSpec<S> subCommand) Adds a subcommand specification.threading(CommandThreading threading) Sets the threading policy.
-
Constructor Details
-
Builder
Creates a builder for the specified command name.- Parameters:
name- command name
-
-
Method Details
-
description
Sets the command description.- Parameters:
description- description text- Returns:
- this builder
-
aliases
Adds command aliases.- Parameters:
aliases- alias list- Returns:
- this builder
-
permission
Sets explicit permission node.- Parameters:
permission- permission string- Returns:
- this builder
-
permissionDefault
Sets the default permission value.- Parameters:
permissionDefault- default permission enum- Returns:
- this builder
-
threading
Sets the threading policy.- Parameters:
threading- threading policy- Returns:
- this builder
-
argument
Adds a single argument.- Parameters:
argument- argument definition- Returns:
- this builder
-
arguments
Adds multiple arguments.- Parameters:
arguments- argument list- Returns:
- this builder
-
execute
Sets the execution handler.- Parameters:
executor- executor implementation- Returns:
- this builder
-
subCommand
Adds a subcommand specification.- Parameters:
subCommand- subcommand spec- Returns:
- this builder
-
mergePolicy
Sets how this command's root execute is owned when merged into a shared root. Defaults toMergePolicy.CONTRIBUTE.- Parameters:
mergePolicy- the merge policy- Returns:
- this builder
-
build
-