Package com.pathplanner.lib.auto
Class NamedCommands
java.lang.Object
com.pathplanner.lib.auto.NamedCommands
Utility class for managing named commands
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CommandgetCommand(String name) Returns the command with the given name.static booleanhasCommand(String name) Returns whether a command with the given name has been registered.static voidregisterCommand(String name, Command command) Registers a command with the given name.static voidregisterCommands(List<Pair<String, Command>> commands) Registers a list of commands with their associated names.static voidregisterCommands(Map<String, Command> commands) Registers a map of commands with their associated names.
-
Constructor Details
-
NamedCommands
public NamedCommands()
-
-
Method Details
-
registerCommand
Registers a command with the given name.- Parameters:
name- the name of the commandcommand- the command to register
-
registerCommands
Registers a list of commands with their associated names.- Parameters:
commands- the list of commands to register
-
registerCommands
Registers a map of commands with their associated names.- Parameters:
commands- the map of commands to register
-
hasCommand
Returns whether a command with the given name has been registered.- Parameters:
name- the name of the command to check- Returns:
- true if a command with the given name has been registered, false otherwise
-
getCommand
Returns the command with the given name.- Parameters:
name- the name of the command to get- Returns:
- the command with the given name, wrapped in a functional command, or a none command if it has not been registered
-