Record Class Scheduler.ScheduleResult.LowerPriorityThanRunningCommand
java.lang.Object
java.lang.Record
org.wpilib.command3.Scheduler.ScheduleResult.LowerPriorityThanRunningCommand
- Record Components:
command- the command that failed to be scheduledalreadyRunning- the running command that prevented the command from being scheduled
- All Implemented Interfaces:
Scheduler.ScheduleResult, Scheduler.ScheduleResult.Failure
- Enclosing interface:
Scheduler.ScheduleResult
public static record Scheduler.ScheduleResult.LowerPriorityThanRunningCommand(Command command, Command alreadyRunning)
extends Record
implements Scheduler.ScheduleResult.Failure
A scheduling attempt that failed because the command was lower priority than a running
command with shared requirements.
-
Nested Class Summary
Nested classes/interfaces inherited from interface Scheduler.ScheduleResult
Scheduler.ScheduleResult.AlreadyRunning, Scheduler.ScheduleResult.Failure, Scheduler.ScheduleResult.LowerPriorityThanQueuedCommand, Scheduler.ScheduleResult.LowerPriorityThanRunningCommand, Scheduler.ScheduleResult.Success, Scheduler.ScheduleResult.Successful -
Constructor Summary
ConstructorsConstructorDescriptionLowerPriorityThanRunningCommand(Command command, Command alreadyRunning) Creates an instance of aLowerPriorityThanRunningCommandrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thealreadyRunningrecord component.command()Returns the value of thecommandrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanA scheduling attempt that failed because the command was lower priority than a running command with shared requirements is always unsuccessful.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
LowerPriorityThanRunningCommand
Creates an instance of aLowerPriorityThanRunningCommandrecord class.- Parameters:
command- the value for thecommandrecord componentalreadyRunning- the value for thealreadyRunningrecord component
-
-
Method Details
-
successful
public boolean successful()A scheduling attempt that failed because the command was lower priority than a running command with shared requirements is always unsuccessful.- Specified by:
successfulin interfaceScheduler.ScheduleResult- Specified by:
successfulin interfaceScheduler.ScheduleResult.Failure- Returns:
- false
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
command
Returns the value of thecommandrecord component.- Specified by:
commandin interfaceScheduler.ScheduleResult- Returns:
- the value of the
commandrecord component
-
alreadyRunning
Returns the value of thealreadyRunningrecord component.- Returns:
- the value of the
alreadyRunningrecord component
-