APIdia Launch Partner
Top Inners Fields Constructors Methods
jdk.internal.net.http.common

public final Class MinimalFuture<T>

extends CompletableFuture<T>
Class Inheritance
Imports
java.util.concurrent.CompletableFuture, .CompletionStage, java.util.concurrent.atomic.AtomicLong

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface

Field Summary

Modifier and TypeField and Description
private final Cancelable
private final long
private static final AtomicLong

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public boolean
cancel(boolean mayInterruptIfRunning)

Overrides java.util.concurrent.CompletableFuture.cancel.

Implements java.util.concurrent.Future.cancel.

If not already completed, completes this CompletableFuture with a CancellationException.

private Cancelable
private static <U> void
complete(CompletableFuture<U> cf, U result, Throwable t)

public static <U> MinimalFuture<U>
completedFuture(U value)

Hides java.util.concurrent.CompletableFuture.completedFuture.

Returns a new CompletableFuture that is already completed with the given value.

public static <U> CompletableFuture<U>
failedFuture(Throwable ex)

Hides java.util.concurrent.CompletableFuture.failedFuture.

Returns a new CompletableFuture that is already completed exceptionally with the given exception.

public <U> MinimalFuture<U>
newIncompleteFuture()

Overrides java.util.concurrent.CompletableFuture.newIncompleteFuture.

Returns a new incomplete CompletableFuture of the type to be returned by a CompletionStage method.

public void
obtrudeException(Throwable ex)

Overrides java.util.concurrent.CompletableFuture.obtrudeException.

Forcibly causes subsequent invocations of method get() and related methods to throw the given exception, whether or not already completed.

public void
obtrudeValue(T value)

Overrides java.util.concurrent.CompletableFuture.obtrudeValue.

Forcibly sets or resets the value subsequently returned by method get() and related methods, whether or not already completed.

public static <U> MinimalFuture<U>
of(CompletionStage<U> stage)

public static <U> CompletableFuture<U>
public String
toString()

Overrides java.util.concurrent.CompletableFuture.toString.

Returns a string identifying this CompletableFuture, as well as its completion state.

Inherited from java.util.concurrent.CompletableFuture:
acceptEitheracceptEitherAsyncacceptEitherAsyncallOfanyOfapplyToEitherapplyToEitherAsyncapplyToEitherAsynccompletecompleteAsynccompleteAsynccompletedStagecompleteExceptionallycompleteOnTimeoutcopydefaultExecutordelayedExecutordelayedExecutorexceptionallyexceptionallyAsyncexceptionallyAsyncexceptionallyComposeexceptionallyComposeAsyncexceptionallyComposeAsyncexceptionNowfailedStagegetgetgetNowgetNumberOfDependentshandlehandleAsynchandleAsyncisCancelledisCompletedExceptionallyisDonejoinminimalCompletionStageorTimeoutresultNowrunAfterBothrunAfterBothAsyncrunAfterBothAsyncrunAfterEitherrunAfterEitherAsyncrunAfterEitherAsyncrunAsyncrunAsyncstatesupplyAsyncsupplyAsyncthenAcceptthenAcceptAsyncthenAcceptAsyncthenAcceptBoththenAcceptBothAsyncthenAcceptBothAsyncthenApplythenApplyAsyncthenApplyAsyncthenCombinethenCombineAsyncthenCombineAsyncthenComposethenComposeAsyncthenComposeAsyncthenRunthenRunAsyncthenRunAsynctoCompletableFuturewhenCompletewhenCompleteAsyncwhenCompleteAsync

Field Detail

cancelableback to summary
private final Cancelable cancelable
idback to summary
private final long id
TOKENSback to summary
private static final AtomicLong TOKENS

Constructor Detail

MinimalFutureback to summary
public MinimalFuture()
MinimalFutureback to summary
public MinimalFuture(Cancelable cancelable)

Method Detail

cancelback to summary
public boolean cancel(boolean mayInterruptIfRunning)

Overrides java.util.concurrent.CompletableFuture.cancel.

Implements java.util.concurrent.Future.cancel.

Doc from java.util.concurrent.CompletableFuture.cancel.

If not already completed, completes this CompletableFuture with a CancellationException. Dependent CompletableFutures that have not already completed will also complete exceptionally, with a CompletionException caused by this CancellationException.

Annotations
@Override
cancelableback to summary
private Cancelable cancelable()
completeback to summary
private static <U> void complete(CompletableFuture<U> cf, U result, Throwable t)
completedFutureback to summary
public static <U> MinimalFuture<U> completedFuture(U value)

Hides java.util.concurrent.CompletableFuture.completedFuture.

Doc from java.util.concurrent.CompletableFuture.completedFuture.

Returns a new CompletableFuture that is already completed with the given value.

failedFutureback to summary
public static <U> CompletableFuture<U> failedFuture(Throwable ex)

Hides java.util.concurrent.CompletableFuture.failedFuture.

Doc from java.util.concurrent.CompletableFuture.failedFuture.

Returns a new CompletableFuture that is already completed exceptionally with the given exception.

newIncompleteFutureback to summary
public <U> MinimalFuture<U> newIncompleteFuture()

Overrides java.util.concurrent.CompletableFuture.newIncompleteFuture.

Doc from java.util.concurrent.CompletableFuture.newIncompleteFuture.

Returns a new incomplete CompletableFuture of the type to be returned by a CompletionStage method. Subclasses should normally override this method to return an instance of the same class as this CompletableFuture. The default implementation returns an instance of class CompletableFuture.

Annotations
@Override
obtrudeExceptionback to summary
public void obtrudeException(Throwable ex)

Overrides java.util.concurrent.CompletableFuture.obtrudeException.

Doc from java.util.concurrent.CompletableFuture.obtrudeException.

Forcibly causes subsequent invocations of method get() and related methods to throw the given exception, whether or not already completed. This method is designed for use only in error recovery actions, and even in such situations may result in ongoing dependent completions using established versus overwritten outcomes.

Annotations
@Override
obtrudeValueback to summary
public void obtrudeValue(T value)

Overrides java.util.concurrent.CompletableFuture.obtrudeValue.

Doc from java.util.concurrent.CompletableFuture.obtrudeValue.

Forcibly sets or resets the value subsequently returned by method get() and related methods, whether or not already completed. This method is designed for use only in error recovery actions, and even in such situations may result in ongoing dependent completions using established versus overwritten outcomes.

Annotations
@Override
ofback to summary
public static <U> MinimalFuture<U> of(CompletionStage<U> stage)
supplyback to summary
public static <U> CompletableFuture<U> supply(MinimalFuture.ExceptionalSupplier<U> supplier)
toStringback to summary
public String toString()

Overrides java.util.concurrent.CompletableFuture.toString.

Doc from java.util.concurrent.CompletableFuture.toString.

Returns a string identifying this CompletableFuture, as well as its completion state. The state, in brackets, contains the String "Completed normally" or the String "Completed exceptionally", or the String "Not completed" followed by the number of CompletableFutures dependent upon its completion, if any.

Annotations
@Override
jdk.internal.net.http.common back to summary

public Interface MinimalFuture.ExceptionalSupplier<U>

Annotations
@FunctionalInterface

Method Summary

Modifier and TypeMethod and Description
public U
get()

Method Detail

getback to summary
public U get() throws Throwable