Class SubCommandHoldable.SubCommandHolder

java.lang.Object
net.okocraft.box.api.command.SubCommandHoldable.SubCommandHolder
Enclosing interface:
SubCommandHoldable

public static class SubCommandHoldable.SubCommandHolder extends Object
A class that holds subcommands.
  • Constructor Details

  • Method Details

    • getSubCommands

      @NotNull public @NotNull @Unmodifiable List<Command> getSubCommands()
      Gets the set of subcommands.

      The returned list can be changed in implementation, but it should not add or remove.

      Returns:
      the list of subcommands
    • register

      public void register(@NotNull @NotNull Command subCommand)
      Registers the new subcommand.
      Parameters:
      subCommand - the new subcommand
    • unregister

      public void unregister(@NotNull @NotNull Command subCommand)
      Unregisters the subcommand.
      Parameters:
      subCommand - the subcommand to unregister
    • search

      @NotNull public @NotNull Optional<Command> search(@NotNull @NotNull String name)
      Searches for a command that matches the name or aliases.
      Parameters:
      name - the name or the alias of the command
      Returns:
      the search result