public class CompletedFuture extends Object
Modifier and Type | Method and Description |
---|---|
static <E> CompletableFuture<E> |
throwing(Throwable throwable)
Creates a completed
Future which will throw the given exception. |
public static <E> CompletableFuture<E> throwing(Throwable throwable)
Future
which will throw the given exception.E
- The type to be returned by this futurethrowable
- A throwable to be thrown upon calling Future.get()
and related
methods.CompletableFuture
which will fail and throw an exception.Copyright © 2016–2018 Yahoo! Inc.. All rights reserved.