class Http2ClientCompletableFutureWithRequest extends CompletableFuture<ClientResponse> implements ClientCallback<ClientExchange> {

    private Logger logger = LoggerFactory.getLogger(Http2ClientCompletableFutureWithRequest.class);

    private String requestBody;
    public Http2ClientCompletableFutureWithRequest(String requestBody) {
        this.requestBody = requestBody;
    }

    @Override
    public void completed(ClientExchange result) {<FILL_FUNCTION_BODY>}

    @Override
    public void failed(IOException e) {
        logger.error("IOException:", e);
        completeExceptionally(e);
    }

}

        new StringWriteChannelListener(requestBody).setup(result.getRequestChannel());
        result.setResponseListener(new ClientCallback<ClientExchange>() {
            @Override
            public void completed(ClientExchange result) {
                new StringReadChannelListener(com.networknt.client.Http2Client.BUFFER_POOL) {
                    @Override
                    protected void stringDone(String string) {
                        if (logger.isDebugEnabled()) {
                            logger.debug("Service call response = {}", string);
                        }
                        result.getResponse().putAttachment(com.networknt.client.Http2Client.RESPONSE_BODY, string);
                        complete(result.getResponse());
                    }

                    @Override
                    protected void error(IOException e) {
                        logger.error("IOException:", e);
                        completeExceptionally(e);
                    }
                }.setup(result.getResponseChannel());
            }

            @Override
            public void failed(IOException e) {
                logger.error("IOException:", e);
                completeExceptionally(e);
            }
        });
    
<methods>public void <init>() ,public CompletableFuture<java.lang.Void> acceptEither(CompletionStage<? extends ClientResponse>, Consumer<? super ClientResponse>) ,public CompletableFuture<java.lang.Void> acceptEitherAsync(CompletionStage<? extends ClientResponse>, Consumer<? super ClientResponse>) ,public CompletableFuture<java.lang.Void> acceptEitherAsync(CompletionStage<? extends ClientResponse>, Consumer<? super ClientResponse>, java.util.concurrent.Executor) ,public static transient CompletableFuture<java.lang.Void> allOf(CompletableFuture<?>[]) ,public static transient CompletableFuture<java.lang.Object> anyOf(CompletableFuture<?>[]) ,public CompletableFuture<U> applyToEither(CompletionStage<? extends ClientResponse>, Function<? super ClientResponse,U>) ,public CompletableFuture<U> applyToEitherAsync(CompletionStage<? extends ClientResponse>, Function<? super ClientResponse,U>) ,public CompletableFuture<U> applyToEitherAsync(CompletionStage<? extends ClientResponse>, Function<? super ClientResponse,U>, java.util.concurrent.Executor) ,public boolean cancel(boolean) ,public boolean complete(ClientResponse) ,public CompletableFuture<ClientResponse> completeAsync(Supplier<? extends ClientResponse>) ,public CompletableFuture<ClientResponse> completeAsync(Supplier<? extends ClientResponse>, java.util.concurrent.Executor) ,public boolean completeExceptionally(java.lang.Throwable) ,public CompletableFuture<ClientResponse> completeOnTimeout(ClientResponse, long, java.util.concurrent.TimeUnit) ,public static CompletableFuture<U> completedFuture(U) ,public static CompletionStage<U> completedStage(U) ,public CompletableFuture<ClientResponse> copy() ,public java.util.concurrent.Executor defaultExecutor() ,public static java.util.concurrent.Executor delayedExecutor(long, java.util.concurrent.TimeUnit) ,public static java.util.concurrent.Executor delayedExecutor(long, java.util.concurrent.TimeUnit, java.util.concurrent.Executor) ,public CompletableFuture<ClientResponse> exceptionally(Function<java.lang.Throwable,? extends ClientResponse>) ,public CompletableFuture<ClientResponse> exceptionallyAsync(Function<java.lang.Throwable,? extends ClientResponse>) ,public CompletableFuture<ClientResponse> exceptionallyAsync(Function<java.lang.Throwable,? extends ClientResponse>, java.util.concurrent.Executor) ,public CompletableFuture<ClientResponse> exceptionallyCompose(Function<java.lang.Throwable,? extends CompletionStage<ClientResponse>>) ,public CompletableFuture<ClientResponse> exceptionallyComposeAsync(Function<java.lang.Throwable,? extends CompletionStage<ClientResponse>>) ,public CompletableFuture<ClientResponse> exceptionallyComposeAsync(Function<java.lang.Throwable,? extends CompletionStage<ClientResponse>>, java.util.concurrent.Executor) ,public static CompletableFuture<U> failedFuture(java.lang.Throwable) ,public static CompletionStage<U> failedStage(java.lang.Throwable) ,public ClientResponse get() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException,public ClientResponse get(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException,public ClientResponse getNow(ClientResponse) ,public int getNumberOfDependents() ,public CompletableFuture<U> handle(BiFunction<? super ClientResponse,java.lang.Throwable,? extends U>) ,public CompletableFuture<U> handleAsync(BiFunction<? super ClientResponse,java.lang.Throwable,? extends U>) ,public CompletableFuture<U> handleAsync(BiFunction<? super ClientResponse,java.lang.Throwable,? extends U>, java.util.concurrent.Executor) ,public boolean isCancelled() ,public boolean isCompletedExceptionally() ,public boolean isDone() ,public ClientResponse join() ,public CompletionStage<ClientResponse> minimalCompletionStage() ,public CompletableFuture<U> newIncompleteFuture() ,public void obtrudeException(java.lang.Throwable) ,public void obtrudeValue(ClientResponse) ,public CompletableFuture<ClientResponse> orTimeout(long, java.util.concurrent.TimeUnit) ,public CompletableFuture<java.lang.Void> runAfterBoth(CompletionStage<?>, java.lang.Runnable) ,public CompletableFuture<java.lang.Void> runAfterBothAsync(CompletionStage<?>, java.lang.Runnable) ,public CompletableFuture<java.lang.Void> runAfterBothAsync(CompletionStage<?>, java.lang.Runnable, java.util.concurrent.Executor) ,public CompletableFuture<java.lang.Void> runAfterEither(CompletionStage<?>, java.lang.Runnable) ,public CompletableFuture<java.lang.Void> runAfterEitherAsync(CompletionStage<?>, java.lang.Runnable) ,public CompletableFuture<java.lang.Void> runAfterEitherAsync(CompletionStage<?>, java.lang.Runnable, java.util.concurrent.Executor) ,public static CompletableFuture<java.lang.Void> runAsync(java.lang.Runnable) ,public static CompletableFuture<java.lang.Void> runAsync(java.lang.Runnable, java.util.concurrent.Executor) ,public static CompletableFuture<U> supplyAsync(Supplier<U>) ,public static CompletableFuture<U> supplyAsync(Supplier<U>, java.util.concurrent.Executor) ,public CompletableFuture<java.lang.Void> thenAccept(Consumer<? super ClientResponse>) ,public CompletableFuture<java.lang.Void> thenAcceptAsync(Consumer<? super ClientResponse>) ,public CompletableFuture<java.lang.Void> thenAcceptAsync(Consumer<? super ClientResponse>, java.util.concurrent.Executor) ,public CompletableFuture<java.lang.Void> thenAcceptBoth(CompletionStage<? extends U>, BiConsumer<? super ClientResponse,? super U>) ,public CompletableFuture<java.lang.Void> thenAcceptBothAsync(CompletionStage<? extends U>, BiConsumer<? super ClientResponse,? super U>) ,public CompletableFuture<java.lang.Void> thenAcceptBothAsync(CompletionStage<? extends U>, BiConsumer<? super ClientResponse,? super U>, java.util.concurrent.Executor) ,public CompletableFuture<U> thenApply(Function<? super ClientResponse,? extends U>) ,public CompletableFuture<U> thenApplyAsync(Function<? super ClientResponse,? extends U>) ,public CompletableFuture<U> thenApplyAsync(Function<? super ClientResponse,? extends U>, java.util.concurrent.Executor) ,public CompletableFuture<V> thenCombine(CompletionStage<? extends U>, BiFunction<? super ClientResponse,? super U,? extends V>) ,public CompletableFuture<V> thenCombineAsync(CompletionStage<? extends U>, BiFunction<? super ClientResponse,? super U,? extends V>) ,public CompletableFuture<V> thenCombineAsync(CompletionStage<? extends U>, BiFunction<? super ClientResponse,? super U,? extends V>, java.util.concurrent.Executor) ,public CompletableFuture<U> thenCompose(Function<? super ClientResponse,? extends CompletionStage<U>>) ,public CompletableFuture<U> thenComposeAsync(Function<? super ClientResponse,? extends CompletionStage<U>>) ,public CompletableFuture<U> thenComposeAsync(Function<? super ClientResponse,? extends CompletionStage<U>>, java.util.concurrent.Executor) ,public CompletableFuture<java.lang.Void> thenRun(java.lang.Runnable) ,public CompletableFuture<java.lang.Void> thenRunAsync(java.lang.Runnable) ,public CompletableFuture<java.lang.Void> thenRunAsync(java.lang.Runnable, java.util.concurrent.Executor) ,public CompletableFuture<ClientResponse> toCompletableFuture() ,public java.lang.String toString() ,public CompletableFuture<ClientResponse> whenComplete(BiConsumer<? super ClientResponse,? super java.lang.Throwable>) ,public CompletableFuture<ClientResponse> whenCompleteAsync(BiConsumer<? super ClientResponse,? super java.lang.Throwable>) ,public CompletableFuture<ClientResponse> whenCompleteAsync(BiConsumer<? super ClientResponse,? super java.lang.Throwable>, java.util.concurrent.Executor) <variables>static final int ASYNC,private static final java.util.concurrent.Executor ASYNC_POOL,static final int NESTED,private static final java.lang.invoke.VarHandle NEXT,static final java.util.concurrent.CompletableFuture.AltResult NIL,private static final java.lang.invoke.VarHandle RESULT,private static final java.lang.invoke.VarHandle STACK,static final int SYNC,private static final boolean USE_COMMON_POOL,volatile java.lang.Object result,volatile java.util.concurrent.CompletableFuture.Completion stack