2025-10-10 16:47:22 -04:00
|
|
|
// Copyright (c) FIRST and other WPILib contributors.
|
|
|
|
|
// Open Source Software; you can modify and/or share it under the terms of
|
|
|
|
|
// the WPILib BSD license file in the root directory of this project.
|
|
|
|
|
|
2025-11-07 19:55:43 -05:00
|
|
|
package org.wpilib.command3;
|
2025-10-10 16:47:22 -04:00
|
|
|
|
2025-11-07 19:55:43 -05:00
|
|
|
import org.wpilib.util.ErrorMessages;
|
2025-10-10 16:47:22 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* A single trigger binding.
|
|
|
|
|
*
|
|
|
|
|
* @param scope The scope in which the binding is active.
|
|
|
|
|
* @param type The type of binding; or, when the bound command should run
|
|
|
|
|
* @param command The bound command. Cannot be null.
|
|
|
|
|
* @param frames The stack frames when the binding was created. Used for telemetry and error
|
|
|
|
|
* reporting so if a command throws an exception, we can tell users where that command was bound
|
|
|
|
|
* instead of giving a fairly useless backtrace of the command framework.
|
|
|
|
|
*/
|
|
|
|
|
record Binding(BindingScope scope, BindingType type, Command command, StackTraceElement[] frames) {
|
|
|
|
|
public Binding {
|
|
|
|
|
ErrorMessages.requireNonNullParam(scope, "scope", "Binding");
|
|
|
|
|
ErrorMessages.requireNonNullParam(type, "type", "Binding");
|
|
|
|
|
ErrorMessages.requireNonNullParam(command, "command", "Binding");
|
|
|
|
|
ErrorMessages.requireNonNullParam(frames, "frames", "Binding");
|
|
|
|
|
}
|
|
|
|
|
}
|