CompletableFuture.copy

Returns a new CompletableFuture that is completed normally with the same value as this CompletableFuture when it completes normally. If this CompletableFuture completes exceptionally, then the returned CompletableFuture completes exceptionally with a CompletionException with this exception as cause. The behavior is equivalent to {@code thenApply(x -> x)}. This method may be useful as a form of "defensive copying", to prevent clients from completing, while still being able to arrange dependent actions.

@return the new CompletableFuture

class CompletableFuture(T)
copy
()

Meta