Class OkHttpFuture<T>

java.lang.Object
java.util.concurrent.CompletableFuture<T>
io.jenkins.plugins.okhttp.api.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 Details

    • GET_RESPONSE

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

    • OkHttpFuture

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

      public OkHttpFuture(okhttp3.Call call, ResponseConverter<T> converter)
  • Method Details