Client and backend. This class is shared: the same code is compiled into your app and into your server, so everything on this page works in both.

public interface CompletionStage<T>

Known subtypesCompletableFuture

java.util.concurrent.CompletionStage: one step of a computation that others can be attached to. CompletableFuture is the implementation.

Methods

public abstract <U> CompletionStage<U> thenApply(Function<? super T, ? extends U> fn)
public abstract <U> CompletionStage<U> thenApplyAsync(Function<? super T, ? extends U> fn)
public abstract <U> CompletionStage<U> thenApplyAsync(Function<? super T, ? extends U> fn, Executor executor)
public abstract CompletionStage<Void> thenAccept(Consumer<? super T> action)
public abstract CompletionStage<Void> thenAcceptAsync(Consumer<? super T> action)
public abstract CompletionStage<Void> thenAcceptAsync(Consumer<? super T> action, Executor executor)
public abstract CompletionStage<Void> thenRun(Runnable action)
public abstract CompletionStage<Void> thenRunAsync(Runnable action)
public abstract CompletionStage<Void> thenRunAsync(Runnable action, Executor executor)
public abstract <U, V> CompletionStage<V> thenCombine(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn)
public abstract <U, V> CompletionStage<V> thenCombineAsync(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn)
public abstract <U, V> CompletionStage<V> thenCombineAsync(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn, Executor executor)
public abstract <U> CompletionStage<Void> thenAcceptBoth(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action)
public abstract <U> CompletionStage<Void> thenAcceptBothAsync(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action)
public abstract <U> CompletionStage<Void> thenAcceptBothAsync(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action, Executor executor)
public abstract CompletionStage<Void> runAfterBoth(CompletionStage<?> other, Runnable action)
public abstract CompletionStage<Void> runAfterBothAsync(CompletionStage<?> other, Runnable action)
public abstract CompletionStage<Void> runAfterBothAsync(CompletionStage<?> other, Runnable action, Executor executor)
public abstract <U> CompletionStage<U> applyToEither(CompletionStage<? extends T> other, Function<? super T, U> fn)
public abstract <U> CompletionStage<U> applyToEitherAsync(CompletionStage<? extends T> other, Function<? super T, U> fn)
public abstract <U> CompletionStage<U> applyToEitherAsync(CompletionStage<? extends T> other, Function<? super T, U> fn, Executor executor)
public abstract CompletionStage<Void> acceptEither(CompletionStage<? extends T> other, Consumer<? super T> action)
public abstract CompletionStage<Void> acceptEitherAsync(CompletionStage<? extends T> other, Consumer<? super T> action)
public abstract CompletionStage<Void> acceptEitherAsync(CompletionStage<? extends T> other, Consumer<? super T> action, Executor executor)
public abstract CompletionStage<Void> runAfterEither(CompletionStage<?> other, Runnable action)
public abstract CompletionStage<Void> runAfterEitherAsync(CompletionStage<?> other, Runnable action)
public abstract CompletionStage<Void> runAfterEitherAsync(CompletionStage<?> other, Runnable action, Executor executor)
public abstract <U> CompletionStage<U> thenCompose(Function<? super T, ? extends CompletionStage<U>> fn)
public abstract <U> CompletionStage<U> thenComposeAsync(Function<? super T, ? extends CompletionStage<U>> fn)
public abstract <U> CompletionStage<U> thenComposeAsync(Function<? super T, ? extends CompletionStage<U>> fn, Executor executor)
public abstract <U> CompletionStage<U> handle(BiFunction<? super T, Throwable, ? extends U> fn)
public abstract <U> CompletionStage<U> handleAsync(BiFunction<? super T, Throwable, ? extends U> fn)
public abstract <U> CompletionStage<U> handleAsync(BiFunction<? super T, Throwable, ? extends U> fn, Executor executor)
public abstract CompletionStage<T> whenComplete(BiConsumer<? super T, ? super Throwable> action)
public abstract CompletionStage<T> whenCompleteAsync(BiConsumer<? super T, ? super Throwable> action)
public abstract CompletionStage<T> whenCompleteAsync(BiConsumer<? super T, ? super Throwable> action, Executor executor)
public abstract CompletionStage<T> exceptionally(Function<Throwable, ? extends T> fn)
public abstract CompletableFuture<T> toCompletableFuture()

Method details

thenApply

public abstract <U> CompletionStage<U> thenApply(Function<? super T, ? extends U> fn)

thenApplyAsync

public abstract <U> CompletionStage<U> thenApplyAsync(Function<? super T, ? extends U> fn)

thenApplyAsync

public abstract <U> CompletionStage<U> thenApplyAsync(Function<? super T, ? extends U> fn, Executor executor)

thenAccept

public abstract CompletionStage<Void> thenAccept(Consumer<? super T> action)

thenAcceptAsync

public abstract CompletionStage<Void> thenAcceptAsync(Consumer<? super T> action)

thenAcceptAsync

public abstract CompletionStage<Void> thenAcceptAsync(Consumer<? super T> action, Executor executor)

thenRun

public abstract CompletionStage<Void> thenRun(Runnable action)

thenRunAsync

public abstract CompletionStage<Void> thenRunAsync(Runnable action)

thenRunAsync

public abstract CompletionStage<Void> thenRunAsync(Runnable action, Executor executor)

thenCombine

public abstract <U, V> CompletionStage<V> thenCombine(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn)

thenCombineAsync

public abstract <U, V> CompletionStage<V> thenCombineAsync(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn)

thenCombineAsync

public abstract <U, V> CompletionStage<V> thenCombineAsync(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn, Executor executor)

thenAcceptBoth

public abstract <U> CompletionStage<Void> thenAcceptBoth(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action)

thenAcceptBothAsync

public abstract <U> CompletionStage<Void> thenAcceptBothAsync(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action)

thenAcceptBothAsync

public abstract <U> CompletionStage<Void> thenAcceptBothAsync(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action, Executor executor)

runAfterBoth

public abstract CompletionStage<Void> runAfterBoth(CompletionStage<?> other, Runnable action)

runAfterBothAsync

public abstract CompletionStage<Void> runAfterBothAsync(CompletionStage<?> other, Runnable action)

runAfterBothAsync

public abstract CompletionStage<Void> runAfterBothAsync(CompletionStage<?> other, Runnable action, Executor executor)

applyToEither

public abstract <U> CompletionStage<U> applyToEither(CompletionStage<? extends T> other, Function<? super T, U> fn)

applyToEitherAsync

public abstract <U> CompletionStage<U> applyToEitherAsync(CompletionStage<? extends T> other, Function<? super T, U> fn)

applyToEitherAsync

public abstract <U> CompletionStage<U> applyToEitherAsync(CompletionStage<? extends T> other, Function<? super T, U> fn, Executor executor)

acceptEither

public abstract CompletionStage<Void> acceptEither(CompletionStage<? extends T> other, Consumer<? super T> action)

acceptEitherAsync

public abstract CompletionStage<Void> acceptEitherAsync(CompletionStage<? extends T> other, Consumer<? super T> action)

acceptEitherAsync

public abstract CompletionStage<Void> acceptEitherAsync(CompletionStage<? extends T> other, Consumer<? super T> action, Executor executor)

runAfterEither

public abstract CompletionStage<Void> runAfterEither(CompletionStage<?> other, Runnable action)

runAfterEitherAsync

public abstract CompletionStage<Void> runAfterEitherAsync(CompletionStage<?> other, Runnable action)

runAfterEitherAsync

public abstract CompletionStage<Void> runAfterEitherAsync(CompletionStage<?> other, Runnable action, Executor executor)

thenCompose

public abstract <U> CompletionStage<U> thenCompose(Function<? super T, ? extends CompletionStage<U>> fn)

thenComposeAsync

public abstract <U> CompletionStage<U> thenComposeAsync(Function<? super T, ? extends CompletionStage<U>> fn)

thenComposeAsync

public abstract <U> CompletionStage<U> thenComposeAsync(Function<? super T, ? extends CompletionStage<U>> fn, Executor executor)

handle

public abstract <U> CompletionStage<U> handle(BiFunction<? super T, Throwable, ? extends U> fn)

handleAsync

public abstract <U> CompletionStage<U> handleAsync(BiFunction<? super T, Throwable, ? extends U> fn)

handleAsync

public abstract <U> CompletionStage<U> handleAsync(BiFunction<? super T, Throwable, ? extends U> fn, Executor executor)

whenComplete

public abstract CompletionStage<T> whenComplete(BiConsumer<? super T, ? super Throwable> action)

whenCompleteAsync

public abstract CompletionStage<T> whenCompleteAsync(BiConsumer<? super T, ? super Throwable> action)

whenCompleteAsync

public abstract CompletionStage<T> whenCompleteAsync(BiConsumer<? super T, ? super Throwable> action, Executor executor)

exceptionally

public abstract CompletionStage<T> exceptionally(Function<Throwable, ? extends T> fn)

toCompletableFuture

public abstract CompletableFuture<T> toCompletableFuture()