mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[commands] Make Java SelectCommand generic (#5849)
This allows users to use any type of map and selector without needing to explicitly match Map<Object, Command>
This commit is contained in:
@@ -36,7 +36,7 @@ public class RobotContainer {
|
||||
// selector does not have to be an enum; it could be any desired type (string, integer,
|
||||
// boolean, double...)
|
||||
private final Command m_exampleSelectCommand =
|
||||
new SelectCommand(
|
||||
new SelectCommand<>(
|
||||
// Maps selector values to commands
|
||||
Map.ofEntries(
|
||||
Map.entry(CommandSelector.ONE, new PrintCommand("Command one was selected!")),
|
||||
|
||||
Reference in New Issue
Block a user