Class Command.Builder

java.lang.Object
dev.polv.taleapi.command.Command.Builder
Enclosing class:
Command

public static final class Command.Builder extends Object
Builder for constructing Command instances.
  • Method Details

    • description

      public Command.Builder description(String description)
      Sets a description for this command.
      Parameters:
      description - the description
      Returns:
      this builder
    • aliases

      public Command.Builder aliases(String... aliases)
      Adds aliases for this command.
      Parameters:
      aliases - the aliases
      Returns:
      this builder
    • permission

      public Command.Builder permission(String permission)
      Sets the permission required to use this command.
      Parameters:
      permission - the permission
      Returns:
      this builder
    • requires

      public Command.Builder requires(Predicate<CommandSender> requirement)
      Sets a custom requirement predicate for this command.
      Parameters:
      requirement - the requirement
      Returns:
      this builder
    • then

      public Command.Builder then(CommandNode<?> child)
      Adds a child node to the root of this command.
      Parameters:
      child - the child node
      Returns:
      this builder
    • executes

      public Command.Builder executes(CommandExecutor executor)
      Sets the executor for the root node.
      Parameters:
      executor - the executor
      Returns:
      this builder
    • build

      public Command build()
      Builds the command.
      Returns:
      the constructed command