Class ConflictDetector

java.lang.Object
org.wpilib.commands3.ConflictDetector

public final class ConflictDetector extends Object
Utility class for helping with detecting conflicts between commands.
  • Method Details

    • throwIfConflicts

      public static void throwIfConflicts(Collection<? extends Command> commands)
      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.