Interface CommandGroup

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default Command command​(java.lang.String name)
      Finds a command by name or alias.
      java.util.Collection<Command> commands()
      Returns all commands in this group.
      default boolean hasCommand​(java.lang.String name)
      Returns whether this group contains a command with the given name or alias.
      default java.lang.String name()
      Returns the name of this command group.
    • Method Detail

      • name

        default java.lang.String name()
        Returns the name of this command group.

        The default implementation returns the simple class name.

        Returns:
        the group name
      • commands

        java.util.Collection<Command> commands()
        Returns all commands in this group.
        Returns:
        the collection of commands, never null
      • command

        default Command command​(java.lang.String name)
        Finds a command by name or alias.

        The default implementation scans commands() for a match.

        Parameters:
        name - the command name or alias
        Returns:
        the command, or null if not found
      • hasCommand

        default boolean hasCommand​(java.lang.String name)
        Returns whether this group contains a command with the given name or alias.
        Parameters:
        name - the command name or alias
        Returns:
        true if a matching command exists