Class FixedLateScheduler<A>
java.lang.Object
ml.karmaconfigs.api.common.timer.scheduler.worker.FixedLateScheduler<A>
- Type Parameters:
A- the A object consumer
- All Implemented Interfaces:
CancellableScheduler,LateScheduler<A>
This scheduler will run a task when X is completed
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidComplete the schedulervoidComplete the schedulerget()Get the A objectbooleanGet if the scheduler is cancelledbooleanGet if the scheduler is completedvoidCancel the schedulerwhenCancelled(Runnable action)Set the cancelled actionwhenComplete(Runnable action)Set the complete actionwhenComplete(BiConsumer<A,Throwable> caughtAction)Set the complete actionwhenComplete(Consumer<A> action)Set the complete actionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ml.karmaconfigs.api.common.timer.scheduler.LateScheduler
thenCompleteUnder
-
Constructor Details
-
FixedLateScheduler
public FixedLateScheduler()
-
-
Method Details
-
whenComplete
Set the complete action- Specified by:
whenCompletein interfaceLateScheduler<A>- Parameters:
action- the action to perform when the scheduler is completed- Returns:
- this instance
-
whenComplete
Set the complete action- Specified by:
whenCompletein interfaceLateScheduler<A>- Parameters:
action- the action to perform when the scheduler is completed- Returns:
- this instance
-
whenComplete
Set the complete action- Specified by:
whenCompletein interfaceLateScheduler<A>- Parameters:
caughtAction- the action to perform when the scheduler is completed- Returns:
- this instance
-
isCompleted
public boolean isCompleted()Get if the scheduler is completed- Specified by:
isCompletedin interfaceLateScheduler<A>- Returns:
- if the shcheduler is complete
-
get
Get the A object- Specified by:
getin interfaceLateScheduler<A>- Returns:
- the A object
-
complete
Complete the scheduler- Specified by:
completein interfaceLateScheduler<A>- Parameters:
target- the type A object
-
complete
Complete the scheduler- Specified by:
completein interfaceLateScheduler<A>- Parameters:
target- the type A objecterror- any error that has been thrown
-
whenCancelled
Set the cancelled action- Specified by:
whenCancelledin interfaceCancellableScheduler- Parameters:
action- the action to perform when the timer is cancelled- Returns:
- a cancellable instance of this
-
isCancelled
public boolean isCancelled()Get if the scheduler is cancelled- Specified by:
isCancelledin interfaceCancellableScheduler- Returns:
- if the scheduler is cancelled
-
setCancelled
public void setCancelled()Cancel the scheduler- Specified by:
setCancelledin interfaceCancellableScheduler
-