Package io.jenkins.plugins.okhttp.api
Class OkHttpFuture<T>
- java.lang.Object
-
- java.util.concurrent.CompletableFuture<T>
-
- io.jenkins.plugins.okhttp.api.OkHttpFuture<T>
-
- Type Parameters:
T
- Type returned when aResponse
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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.concurrent.CompletableFuture
CompletableFuture.AsynchronousCompletionTask
-
-
Field Summary
Fields Modifier and Type Field Description static ResponseConverter<okhttp3.Response>
GET_RESPONSE
A converter returning the response itself.
-
Constructor Summary
Constructors Constructor Description OkHttpFuture(okhttp3.Call call)
Creates a future with no converter.OkHttpFuture(okhttp3.Call call, ResponseConverter<T> converter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
cancel(boolean mayInterruptIfRunning)
-
Methods inherited from class java.util.concurrent.CompletableFuture
acceptEither, acceptEitherAsync, acceptEitherAsync, allOf, anyOf, applyToEither, applyToEitherAsync, applyToEitherAsync, complete, completeAsync, completeAsync, completedFuture, completedStage, completeExceptionally, completeOnTimeout, copy, defaultExecutor, delayedExecutor, delayedExecutor, exceptionally, failedFuture, failedStage, get, get, getNow, getNumberOfDependents, handle, handleAsync, handleAsync, isCancelled, isCompletedExceptionally, isDone, join, minimalCompletionStage, newIncompleteFuture, obtrudeException, obtrudeValue, orTimeout, runAfterBoth, runAfterBothAsync, runAfterBothAsync, runAfterEither, runAfterEitherAsync, runAfterEitherAsync, runAsync, runAsync, supplyAsync, supplyAsync, thenAccept, thenAcceptAsync, thenAcceptAsync, thenAcceptBoth, thenAcceptBothAsync, thenAcceptBothAsync, thenApply, thenApplyAsync, thenApplyAsync, thenCombine, thenCombineAsync, thenCombineAsync, thenCompose, thenComposeAsync, thenComposeAsync, thenRun, thenRunAsync, thenRunAsync, toCompletableFuture, toString, whenComplete, whenCompleteAsync, whenCompleteAsync
-
-
-
-
Field Detail
-
GET_RESPONSE
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.- Parameters:
call
- The call that must be executed. Can not benull
-
OkHttpFuture
public OkHttpFuture(okhttp3.Call call, ResponseConverter<T> converter)
-
-