Class SimpleCommandGroup

java.lang.Object
org.jline.shell.impl.SimpleCommandGroup
All Implemented Interfaces:
CommandGroup
Direct Known Subclasses:
AliasCommands, ExitCommands, HelpCommands, HistoryCommands, JobCommands, OptionCommands

public class SimpleCommandGroup extends Object implements CommandGroup
Default implementation of CommandGroup backed by a list of commands.
Since:
4.0
See Also:
  • Constructor Details

    • SimpleCommandGroup

      public SimpleCommandGroup(String name, Command... commands)
      Creates a new command group with the given name and commands.
      Parameters:
      name - the group name
      commands - the commands in this group
    • SimpleCommandGroup

      public SimpleCommandGroup(String name, Collection<Command> commands)
      Creates a new command group with the given name and commands.
      Parameters:
      name - the group name
      commands - the commands in this group
  • Method Details

    • name

      public String name()
      Description copied from interface: CommandGroup
      Returns the name of this command group.

      The default implementation returns the simple class name.

      Specified by:
      name in interface CommandGroup
      Returns:
      the group name
    • commands

      public Collection<Command> commands()
      Description copied from interface: CommandGroup
      Returns all commands in this group.
      Specified by:
      commands in interface CommandGroup
      Returns:
      the collection of commands, never null