Class AbstractPromise<T>
java.lang.Object
com.ticxo.modelengine.api.utils.promise.AbstractPromise<T>
- Direct Known Subclasses:
AbstractFoliaPromise
,LegacyPromise
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
cancel
(boolean mayInterruptIfRunning) protected abstract <U> AbstractPromise<U>
protected abstract void
executeAsync
(Runnable runnable) protected abstract void
executeAsync
(Runnable runnable, int delay) protected abstract void
executeSync
(Runnable runnable) protected abstract void
executeSync
(Runnable runnable, int delay) get()
boolean
boolean
isDone()
runAsyncDelay
(Runnable runnable, int delay) runSyncDelay
(Runnable runnable, int delay) supplyAsync
(Supplier<T> supplier) supplyAsyncDelay
(Supplier<T> supplier, int delay) supplySync
(Supplier<T> supplier) supplySyncDelay
(Supplier<T> supplier, int delay) <U> Promise<U>
thenApplyAsync
(Function<? super T, ? extends U> function) <U> Promise<U>
thenApplyAsyncDelay
(Function<? super T, ? extends U> function, int delay) <U> Promise<U>
thenApplySync
(Function<? super T, ? extends U> function) <U> Promise<U>
thenApplySyncDelay
(Function<? super T, ? extends U> function, int delay) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.ticxo.modelengine.api.utils.promise.Promise
thenAcceptAsync, thenAcceptAsyncDelay, thenAcceptSync, thenAcceptSyncDelay, thenRunAsync, thenRunAsyncDelay, thenRunSync, thenRunSyncDelay
-
Constructor Details
-
AbstractPromise
protected AbstractPromise() -
AbstractPromise
-
-
Method Details
-
runSync
-
runSyncDelay
- Specified by:
runSyncDelay
in interfacePromise<T>
-
runAsync
-
runAsyncDelay
- Specified by:
runAsyncDelay
in interfacePromise<T>
-
supplySync
- Specified by:
supplySync
in interfacePromise<T>
-
supplySyncDelay
- Specified by:
supplySyncDelay
in interfacePromise<T>
-
supplyAsync
- Specified by:
supplyAsync
in interfacePromise<T>
-
supplyAsyncDelay
- Specified by:
supplyAsyncDelay
in interfacePromise<T>
-
thenApplySync
- Specified by:
thenApplySync
in interfacePromise<T>
-
thenApplySyncDelay
- Specified by:
thenApplySyncDelay
in interfacePromise<T>
-
thenApplyAsync
- Specified by:
thenApplyAsync
in interfacePromise<T>
-
thenApplyAsyncDelay
- Specified by:
thenApplyAsyncDelay
in interfacePromise<T>
-
cancel
public boolean cancel(boolean mayInterruptIfRunning) -
isCancelled
public boolean isCancelled()- Specified by:
isCancelled
in interfaceFuture<T>
-
isDone
public boolean isDone() -
get
- Specified by:
get
in interfaceFuture<T>
- Throws:
InterruptedException
ExecutionException
-
get
public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException - Specified by:
get
in interfaceFuture<T>
- Throws:
InterruptedException
ExecutionException
TimeoutException
-
createEmpty
-
executeSync
-
executeSync
-
executeAsync
-
executeAsync
-