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.T - the future's generic type.throwable - the exceptionCompletableFuture instance.public static <T> CompletableFuture<T> firstCompletedWithoutException(@NonNull CompletionStage<? extends T>... futures)
T - the future's generic type.futures - array of futures.public static <T> CompletableFuture<T> firstCompletedWithoutException(@NonNull @NonNull List<? extends CompletionStage<? extends T>> futures)
T - the future's generic type.futures - list of futures.public static <T> CompletableFuture<T> toCompletableFuture(@NonNull @NonNull Future<T> future)
Future instance into CompletableFuture.T - the future's generic type.future - for transform.CompletableFuture instance.Copyright © 2019–2020 Appulse. All rights reserved.