Package com.pathplanner.lib.auto
Class NamedCommands
java.lang.Object
com.pathplanner.lib.auto.NamedCommands
Utility class for managing named commands
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Command
getCommand
(String name) Returns the command with the given name.static boolean
hasCommand
(String name) Returns whether a command with the given name has been registered.static void
registerCommand
(String name, Command command) Registers a command with the given name.static void
registerCommands
(List<Pair<String, Command>> commands) Registers a list of commands with their associated names.static void
registerCommands
(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
-