Interface Scheduler.ScheduleResult
- All Known Subinterfaces:
Scheduler.ScheduleResult.Failure, Scheduler.ScheduleResult.Successful
- All Known Implementing Classes:
Scheduler.ScheduleResult.AlreadyRunning, Scheduler.ScheduleResult.LowerPriorityThanQueuedCommand, Scheduler.ScheduleResult.LowerPriorityThanRunningCommand, Scheduler.ScheduleResult.Success
- Enclosing class:
Scheduler
public static sealed interface Scheduler.ScheduleResult
permits Scheduler.ScheduleResult.Successful, Scheduler.ScheduleResult.Failure
Represents possible results of a command scheduling attempt. These can be used either as
concrete results after a command was attempted to be scheduled, or as predictive results when
checking if a command can be scheduled before committing to it.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordA scheduling attempt that was redundant because the command was already running.static interfaceCommon interface for failed scheduling attempts.static final recordA scheduling attempt that failed because the command was lower priority than a queued command with shared requirements.static final recordA scheduling attempt that failed because the command was lower priority than a running command with shared requirements.static final recordA successful scheduling attempt.static interfaceCommon interface for successful scheduling attempts. -
Method Summary
Modifier and TypeMethodDescriptioncommand()The command that was attempted to be scheduled.booleanWhether the scheduling attempt was successful.
-
Method Details
-
command
Command command()The command that was attempted to be scheduled.- Returns:
- the command that was attempted to be scheduled
-
successful
boolean successful()Whether the scheduling attempt was successful.- Returns:
- true if the scheduling attempt was successful, false if it failed
-