| Constructor and Description |
|---|
PassivePromise() |
| Modifier and Type | Method and Description |
|---|---|
<R> R |
accept(java.util.function.Function<HK<Promise,T,Promise<T>>,R> f) |
boolean |
cancel(boolean mayInterruptIfRunning) |
HK<Promise,T,Promise<T>> |
filter(java.util.function.Predicate<? super T> predicate)
Method called when the current data must be filtered using a given predicate.
|
<R> Promise<R> |
flatmap(java.util.function.Function<? super T,Promise<R>> function)
Method use to flatmap a function.
|
T |
get() |
T |
get(long timeout,
TimeUnit unit) |
Future<T> |
getFuture()
Provides the underlying future able to capture and returns the result or the error for a given execution
|
boolean |
isCancelled() |
boolean |
isDone() |
<R> Promise<R> |
map(FunctionWithError<? super T,R> function)
Method use to map a function.
|
void |
onComplete(java.util.function.Consumer<Try<T>> consumer)
Callback called when the computation terminates
|
void |
onFailure(java.util.function.Consumer<Throwable> consumer)
Callback called when the computation fails
|
void |
onSuccess(java.util.function.Consumer<T> consumer)
Callback called when the computation succeed
|
void |
response(Try<T> response) |
Promise<T> |
self() |
public Future<T> getFuture()
Promisepublic void onSuccess(java.util.function.Consumer<T> consumer)
Promisepublic void onFailure(java.util.function.Consumer<Throwable> consumer)
Promisepublic void onComplete(java.util.function.Consumer<Try<T>> consumer)
PromiseonComplete in interface Promise<T>consumer - The callback to be activated on completionpublic boolean cancel(boolean mayInterruptIfRunning)
public boolean isCancelled()
isCancelled in interface Future<T>public T get() throws InterruptedException, ExecutionException
get in interface Future<T>InterruptedExceptionExecutionExceptionpublic T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get in interface Future<T>InterruptedExceptionExecutionExceptionTimeoutExceptionpublic <R> R accept(java.util.function.Function<HK<Promise,T,Promise<T>>,R> f)
public final <R> Promise<R> map(FunctionWithError<? super T,R> function)
Promisepublic final <R> Promise<R> flatmap(java.util.function.Function<? super T,Promise<R>> function)
Promisepublic HK<Promise,T,Promise<T>> filter(java.util.function.Predicate<? super T> predicate)
FilterCopyright © 2017. All rights reserved.