Class CompletedTask<V>
- java.lang.Object
-
- de.dytanic.cloudnet.common.concurrent.CompletedTask<V>
-
-
Constructor Summary
Constructors Constructor Description CompletedTask(V value, java.lang.Throwable throwable)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull ITask<V>addListener(ITaskListener<V> listener)Vcall()booleancancel(boolean b)@NotNull ITask<V>clearListeners()static <V> ITask<V>create(V value)static <V> ITask<V>createFailed(java.lang.Throwable throwable)Vget()Vget(long l, @NotNull java.util.concurrent.TimeUnit timeUnit)Vget(long time, java.util.concurrent.TimeUnit timeUnit, V def)java.util.concurrent.Callable<V>getCallable()VgetDef(V def)java.util.Collection<ITaskListener<V>>getListeners()booleanisCancelled()booleanisDone()<T> ITask<T>mapThrowable(ThrowableFunction<V,T,java.lang.Throwable> mapper)static ITask<java.lang.Void>voidTask()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.dytanic.cloudnet.common.concurrent.ITask
addListener, fireExceptionOnFailure, map, onCancelled, onComplete, onComplete, onFailure, onFailure
-
-
-
-
Constructor Detail
-
CompletedTask
public CompletedTask(V value, java.lang.Throwable throwable)
-
-
Method Detail
-
createFailed
public static <V> ITask<V> createFailed(java.lang.Throwable throwable)
-
create
public static <V> ITask<V> create(V value)
-
voidTask
public static ITask<java.lang.Void> voidTask()
-
addListener
@NotNull public @NotNull ITask<V> addListener(ITaskListener<V> listener)
- Specified by:
addListenerin interfaceITask<V>
-
clearListeners
@NotNull public @NotNull ITask<V> clearListeners()
- Specified by:
clearListenersin interfaceITask<V>
-
getListeners
public java.util.Collection<ITaskListener<V>> getListeners()
- Specified by:
getListenersin interfaceITask<V>
-
getCallable
public java.util.concurrent.Callable<V> getCallable()
- Specified by:
getCallablein interfaceITask<V>
-
mapThrowable
public <T> ITask<T> mapThrowable(ThrowableFunction<V,T,java.lang.Throwable> mapper)
- Specified by:
mapThrowablein interfaceITask<V>
-
call
public V call() throws java.lang.Exception
- Specified by:
callin interfacejava.util.concurrent.Callable<V>- Throws:
java.lang.Exception
-
cancel
public boolean cancel(boolean b)
- Specified by:
cancelin interfacejava.util.concurrent.Future<V>
-
isCancelled
public boolean isCancelled()
- Specified by:
isCancelledin interfacejava.util.concurrent.Future<V>
-
isDone
public boolean isDone()
- Specified by:
isDonein interfacejava.util.concurrent.Future<V>
-
-