Class OkHttpFuture<T>

  • Type Parameters:
    T - Type returned when a Response is get.
    All Implemented Interfaces:
    CompletionStage<T>, Future<T>

    public class OkHttpFuture<T>
    extends CompletableFuture<T>
    Provides a mechanism to transform an HTTP response asynchronously relying only on JDK APIs.
    • Field Detail


        public static final ResponseConverter<okhttp3.Response> GET_RESPONSE
        A converter returning the response itself.
    • Constructor Detail

      • OkHttpFuture

        public OkHttpFuture​(okhttp3.Call call)
        Creates a future with no converter.
        call - The call that must be executed. Can not be null
      • OkHttpFuture

        public OkHttpFuture​(okhttp3.Call call,
                            ResponseConverter<T> converter)