/*
* JBoss, Home of Professional Open Source
* Copyright 2014, Red Hat, Inc., and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.weld.util;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionStage;
import java.util.concurrent.Executor;
import java.util.function.BiConsumer;
import java.util.function.BiFunction;
import java.util.function.Consumer;
import java.util.function.Function;
public abstract class ForwardingCompletionStage<T> implements CompletionStage<T> {
protected abstract CompletionStage<T> delegate();
@Override
public <U> CompletionStage<U> thenApply(Function<? super T, ? extends U> fn) {
return delegate().thenApply(fn);
}
@Override
public <U> CompletionStage<U> thenApplyAsync(Function<? super T, ? extends U> fn) {
return delegate().thenApplyAsync(fn);
}
@Override
public <U> CompletionStage<U> thenApplyAsync(Function<? super T, ? extends U> fn, Executor executor) {
return delegate().thenApplyAsync(fn, executor);
}
@Override
public CompletionStage<Void> thenAccept(Consumer<? super T> action) {
return delegate().thenAccept(action);
}
@Override
public CompletionStage<Void> thenAcceptAsync(Consumer<? super T> action) {
return delegate().thenAcceptAsync(action);
}
@Override
public CompletionStage<Void> thenAcceptAsync(Consumer<? super T> action, Executor executor) {
return delegate().thenAcceptAsync(action, executor);
}
@Override
public CompletionStage<Void> thenRun(Runnable action) {
return delegate().thenRun(action);
}
@Override
public CompletionStage<Void> thenRunAsync(Runnable action) {
return delegate().thenRunAsync(action);
}
@Override
public CompletionStage<Void> thenRunAsync(Runnable action, Executor executor) {
return delegate().thenRunAsync(action, executor);
}
@Override
public <U, V> CompletionStage<V> thenCombine(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn) {
return delegate().thenCombine(other, fn);
}
@Override
public <U, V> CompletionStage<V> thenCombineAsync(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn) {
return delegate().thenCombineAsync(other, fn);
}
@Override
public <U, V> CompletionStage<V> thenCombineAsync(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn, Executor executor) {
return delegate().thenCombineAsync(other, fn, executor);
}
@Override
public <U> CompletionStage<Void> thenAcceptBoth(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action) {
return delegate().thenAcceptBoth(other, action);
}
@Override
public <U> CompletionStage<Void> thenAcceptBothAsync(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action) {
return delegate().thenAcceptBothAsync(other, action);
}
@Override
public <U> CompletionStage<Void> thenAcceptBothAsync(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action, Executor executor) {
return delegate().thenAcceptBothAsync(other, action, executor);
}
@Override
public CompletionStage<Void> runAfterBoth(CompletionStage<?> other, Runnable action) {
return delegate().runAfterBoth(other, action);
}
@Override
public CompletionStage<Void> runAfterBothAsync(CompletionStage<?> other, Runnable action) {
return delegate().runAfterBothAsync(other, action);
}
@Override
public CompletionStage<Void> runAfterBothAsync(CompletionStage<?> other, Runnable action, Executor executor) {
return delegate().runAfterBothAsync(other, action, executor);
}
@Override
public <U> CompletionStage<U> applyToEither(CompletionStage<? extends T> other, Function<? super T, U> fn) {
return delegate().applyToEither(other, fn);
}
@Override
public <U> CompletionStage<U> applyToEitherAsync(CompletionStage<? extends T> other, Function<? super T, U> fn) {
return delegate().applyToEitherAsync(other, fn);
}
@Override
public <U> CompletionStage<U> applyToEitherAsync(CompletionStage<? extends T> other, Function<? super T, U> fn, Executor executor) {
return delegate().applyToEitherAsync(other, fn, executor);
}
@Override
public CompletionStage<Void> acceptEither(CompletionStage<? extends T> other, Consumer<? super T> action) {
return delegate().acceptEither(other, action);
}
@Override
public CompletionStage<Void> acceptEitherAsync(CompletionStage<? extends T> other, Consumer<? super T> action) {
return delegate().acceptEitherAsync(other, action);
}
@Override
public CompletionStage<Void> acceptEitherAsync(CompletionStage<? extends T> other, Consumer<? super T> action, Executor executor) {
return delegate().acceptEitherAsync(other, action, executor);
}
@Override
public CompletionStage<Void> runAfterEither(CompletionStage<?> other, Runnable action) {
return delegate().runAfterEither(other, action);
}
@Override
public CompletionStage<Void> runAfterEitherAsync(CompletionStage<?> other, Runnable action) {
return delegate().runAfterEitherAsync(other, action);
}
@Override
public CompletionStage<Void> runAfterEitherAsync(CompletionStage<?> other, Runnable action, Executor executor) {
return delegate().runAfterEitherAsync(other, action, executor);
}
@Override
public <U> CompletionStage<U> thenCompose(Function<? super T, ? extends CompletionStage<U>> fn) {
return delegate().thenCompose(fn);
}
@Override
public <U> CompletionStage<U> thenComposeAsync(Function<? super T, ? extends CompletionStage<U>> fn) {
return delegate().thenComposeAsync(fn);
}
@Override
public <U> CompletionStage<U> thenComposeAsync(Function<? super T, ? extends CompletionStage<U>> fn, Executor executor) {
return delegate().thenComposeAsync(fn, executor);
}
@Override
public CompletionStage<T> exceptionally(Function<Throwable, ? extends T> fn) {
return delegate().exceptionally(fn);
}
@Override
public CompletionStage<T> whenComplete(BiConsumer<? super T, ? super Throwable> action) {
return delegate().whenComplete(action);
}
@Override
public CompletionStage<T> whenCompleteAsync(BiConsumer<? super T, ? super Throwable> action) {
return delegate().whenCompleteAsync(action);
}
@Override
public CompletionStage<T> whenCompleteAsync(BiConsumer<? super T, ? super Throwable> action, Executor executor) {
return delegate().whenCompleteAsync(action, executor);
}
@Override
public <U> CompletionStage<U> handle(BiFunction<? super T, Throwable, ? extends U> fn) {
return delegate().handle(fn);
}
@Override
public <U> CompletionStage<U> handleAsync(BiFunction<? super T, Throwable, ? extends U> fn) {
return delegate().handleAsync(fn);
}
@Override
public <U> CompletionStage<U> handleAsync(BiFunction<? super T, Throwable, ? extends U> fn, Executor executor) {
return delegate().handleAsync(fn, executor);
}
@Override
public CompletableFuture<T> toCompletableFuture() {
return delegate().toCompletableFuture();
}
}