Package org.bitcoinj.utils
Class ListenableCompletableFuture<V>
java.lang.Object
java.util.concurrent.CompletableFuture<V>
org.bitcoinj.utils.ListenableCompletableFuture<V>
- All Implemented Interfaces:
 com.google.common.util.concurrent.ListenableFuture<V>,CompletionStage<V>,Future<V>,ListenableCompletionStage<V>
public class ListenableCompletableFuture<V>
extends CompletableFuture<V>
implements ListenableCompletionStage<V>
A 
CompletableFuture that is also a ListenableFuture for migration
 from Guava ListenableFuture to CompletableFuture. This allows clients of bitcoinj to change the type
 of variables receiving Futures from bitcoinj methods. You must switch from Guava's
 ListenableFuture (and related types) to Java 8's CompletableFuture.
 Release 0.18 of bitcoinj will remove this class,
 and the type of returned futures from bitcoinj, will be changed to CompletableFuture.
 WARNING: This class should be considered Deprecated for Removal, as it will be removed in Release 0.18. See above for details.
- 
Nested Class Summary
Nested classes/interfaces inherited from class java.util.concurrent.CompletableFuture
CompletableFuture.AsynchronousCompletionTask - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ListenableCompletableFuture<T>completedFuture(T value) Deprecated.static <T> ListenableCompletableFuture<T>failedFuture(Throwable throwable) Deprecated.Usenew CompletableFuture() + CompletableFuture.completeExceptionally()or if JDK 9+ useCompletableFuture.failedFuture()static <T> ListenableCompletableFuture<T>of(CompletableFuture<T> future) Deprecated.Don't convert toListenableCompletableFuture, useCompletableFuturedirectly.Methods inherited from class java.util.concurrent.CompletableFuture
acceptEither, acceptEitherAsync, acceptEitherAsync, allOf, anyOf, applyToEither, applyToEitherAsync, applyToEitherAsync, cancel, complete, completeAsync, completeAsync, completedStage, completeExceptionally, completeOnTimeout, copy, defaultExecutor, delayedExecutor, delayedExecutor, exceptionally, exceptionallyAsync, exceptionallyAsync, exceptionallyCompose, exceptionallyComposeAsync, exceptionallyComposeAsync, failedStage, get, get, getNow, getNumberOfDependents, handle, handleAsync, handleAsync, isCancelled, isCompletedExceptionally, isDone, join, minimalCompletionStage, newIncompleteFuture, obtrudeException, obtrudeValue, orTimeout, runAfterBoth, runAfterBothAsync, runAfterBothAsync, runAfterEither, runAfterEitherAsync, runAfterEitherAsync, runAsync, runAsync, supplyAsync, supplyAsync, thenAccept, thenAcceptAsync, thenAcceptAsync, thenAcceptBoth, thenAcceptBothAsync, thenAcceptBothAsync, thenApply, thenApplyAsync, thenApplyAsync, thenCombine, thenCombineAsync, thenCombineAsync, thenCompose, thenComposeAsync, thenComposeAsync, thenRun, thenRunAsync, thenRunAsync, toCompletableFuture, toString, whenComplete, whenCompleteAsync, whenCompleteAsyncMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.concurrent.CompletionStage
acceptEither, acceptEitherAsync, acceptEitherAsync, applyToEither, applyToEitherAsync, applyToEitherAsync, exceptionally, exceptionallyAsync, exceptionallyAsync, exceptionallyCompose, exceptionallyComposeAsync, exceptionallyComposeAsync, handle, handleAsync, handleAsync, runAfterBoth, runAfterBothAsync, runAfterBothAsync, runAfterEither, runAfterEitherAsync, runAfterEitherAsync, thenAccept, thenAcceptAsync, thenAcceptAsync, thenAcceptBoth, thenAcceptBothAsync, thenAcceptBothAsync, thenApply, thenApplyAsync, thenApplyAsync, thenCombine, thenCombineAsync, thenCombineAsync, thenCompose, thenComposeAsync, thenComposeAsync, thenRun, thenRunAsync, thenRunAsync, toCompletableFuture, whenComplete, whenCompleteAsync, whenCompleteAsyncMethods inherited from interface org.bitcoinj.utils.ListenableCompletionStage
addListener 
- 
Constructor Details
- 
ListenableCompletableFuture
public ListenableCompletableFuture() 
 - 
 - 
Method Details
- 
completedFuture
Deprecated.Returns a newCompletableFuturethat is already completed with the given value.- Type Parameters:
 T- the type of the value- Parameters:
 value- the value- Returns:
 - the completed CompletableFuture
 
 - 
failedFuture
Deprecated.Usenew CompletableFuture() + CompletableFuture.completeExceptionally()or if JDK 9+ useCompletableFuture.failedFuture()Returns a newListenableCompletableFuturethat is already completed exceptionally with the given throwable.- Type Parameters:
 T- the type of the expected value- Parameters:
 throwable- the exceptions- Returns:
 - the completed CompletableFuture
 
 - 
of
Deprecated.Don't convert toListenableCompletableFuture, useCompletableFuturedirectly.Converts a genericCompletableFutureto aListenableCompletableFuture. If the passed in future is already aListenableCompletableFutureno conversion is performed.- Type Parameters:
 T- the type of the futures return value- Parameters:
 future- A CompletableFuture that may need to be converted- Returns:
 - A ListenableCompletableFuture
 
 
 - 
 
CompletableFuture.completedFuture(Object)