public final class FutureUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> CompletableFuture<T> |
completedExceptionally(Throwable throwable)
Creates
CompletableFuture instance and completes it with specified exception. |
static <T> CompletableFuture<T> |
firstCompletedWithoutException(CompletionStage<? extends T>... futures)
Returns first completed future, which didn't throw an exception.
|
static <T> CompletableFuture<T> |
firstCompletedWithoutException(@NonNull List<? extends CompletionStage<? extends T>> futures)
Returns first completed future, which didn't throw an exception.
|
static <T> CompletableFuture<T> |
toCompletableFuture(@NonNull Future<T> future)
Transforms standard stdlib's
Future instance into CompletableFuture. |
public static <T> CompletableFuture<T> completedExceptionally(Throwable throwable)
CompletableFuture instance and completes it with specified exception.throwable - the exceptionCompletableFuture instance.public static <T> CompletableFuture<T> firstCompletedWithoutException(@NonNull CompletionStage<? extends T>... futures)
futures - array of futures.public static <T> CompletableFuture<T> firstCompletedWithoutException(@NonNull @NonNull List<? extends CompletionStage<? extends T>> futures)
futures - list of futures.public static <T> CompletableFuture<T> toCompletableFuture(@NonNull @NonNull Future<T> future)
Future instance into CompletableFuture.future - for transform.CompletableFuture instance.Copyright © 2019 Appulse. All rights reserved.