Modifier and Type | Method and Description |
---|---|
static <T,E extends Exception> |
futureToPromise(CompletionStage<T> completionStage,
Class<E> exceptionType)
Converts a
CompletionStage to a Promise . |
static <T,E extends Exception> |
promiseToFuture(Promise<T,E> promise)
Converts a
Promise to a CompletableFuture . |
public static <T,E extends Exception> CompletableFuture<T> promiseToFuture(Promise<T,E> promise)
Promise
to a CompletableFuture
.T
- The type's result of the promise.E
- The type of the exception thrown by the promise.promise
- The promise to convert.CompletableFuture
.public static <T,E extends Exception> Promise<T,E> futureToPromise(CompletionStage<T> completionStage, Class<E> exceptionType)
CompletionStage
to a Promise
.T
- The type's result expected by the promise.E
- The type of the exception expected by the promise.completionStage
- The completion stage to convert.exceptionType
- The expected exception type, not null
.Promise
.NullPointerException
- if the exceptionType is null
.Copyright 2011-2017 ForgeRock AS.