Package org.wpilib.commands3
Class ConflictDetector
java.lang.Object
org.wpilib.commands3.ConflictDetector
Utility class for helping with detecting conflicts between commands.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA conflict between two commands. -
Method Summary
Modifier and TypeMethodDescriptionstatic List<ConflictDetector.Conflict> findAllConflicts(Collection<? extends Command> commands) Finds all conflicting pairs of commands in the input collection.static voidthrowIfConflicts(Collection<? extends Command> commands) Validates that a set of commands have no internal requirement conflicts.
-
Method Details
-
throwIfConflicts
Validates that a set of commands have no internal requirement conflicts. An error is thrown if a conflict is detected.- Parameters:
commands- The commands to validate- Throws:
IllegalArgumentException- If at least one pair of commands is found in the input where both commands have at least one required mechanism in common
-
findAllConflicts
public static List<ConflictDetector.Conflict> findAllConflicts(Collection<? extends Command> commands) Finds all conflicting pairs of commands in the input collection.- Parameters:
commands- The commands to check.- Returns:
- All detected conflicts. The returned list is empty if no conflicts were found.
-