diff options
Diffstat (limited to 'lib/java/src/main/java/org/apache/thrift/async/AsyncMethodFutureAdapter.java')
-rw-r--r-- | lib/java/src/main/java/org/apache/thrift/async/AsyncMethodFutureAdapter.java | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/lib/java/src/main/java/org/apache/thrift/async/AsyncMethodFutureAdapter.java b/lib/java/src/main/java/org/apache/thrift/async/AsyncMethodFutureAdapter.java index 0bee3a7cf..202af7bff 100644 --- a/lib/java/src/main/java/org/apache/thrift/async/AsyncMethodFutureAdapter.java +++ b/lib/java/src/main/java/org/apache/thrift/async/AsyncMethodFutureAdapter.java @@ -3,33 +3,33 @@ package org.apache.thrift.async; import java.util.concurrent.CompletableFuture; /** - * A simple adapter that bridges {@link AsyncMethodCallback} with {@link CompletableFuture}-returning style clients. - * Compiler generated code will invoke this adapter to implement {@code FutureClient}s. + * A simple adapter that bridges {@link AsyncMethodCallback} with {@link + * CompletableFuture}-returning style clients. Compiler generated code will invoke this adapter to + * implement {@code FutureClient}s. * * @param <T> return type (can be {@link Void}). */ public final class AsyncMethodFutureAdapter<T> implements AsyncMethodCallback<T> { - private AsyncMethodFutureAdapter() { - } + private AsyncMethodFutureAdapter() {} - public static <T> AsyncMethodFutureAdapter<T> create() { - return new AsyncMethodFutureAdapter<>(); - } + public static <T> AsyncMethodFutureAdapter<T> create() { + return new AsyncMethodFutureAdapter<>(); + } - private final CompletableFuture<T> future = new CompletableFuture<>(); + private final CompletableFuture<T> future = new CompletableFuture<>(); - public CompletableFuture<T> getFuture() { - return future; - } + public CompletableFuture<T> getFuture() { + return future; + } - @Override - public void onComplete(T response) { - future.complete(response); - } + @Override + public void onComplete(T response) { + future.complete(response); + } - @Override - public void onError(Exception exception) { - future.completeExceptionally(exception); - } + @Override + public void onError(Exception exception) { + future.completeExceptionally(exception); + } } |