InputT
- Currently configured input type to the RequestPipeline
.OutputT
- Currently configured output type to the RequestPipeline
.@Immutable public final class RequestPipelineBuilder<InputT,OutputT> extends Object
RequestPipeline
.Modifier and Type | Method and Description |
---|---|
static <InputT,OutputT> |
async(Function<HttpClientDependencies,RequestPipeline<InputT,OutputT>> pipelineFactory)
Convert a synchronous
RequestPipeline factory into a factory that produces a version of the RequestPipeline
that accepts a CompletableFuture and returns a CompletableFuture. |
static <InputT,OutputT> |
async(Supplier<RequestPipeline<InputT,OutputT>> pipelineFactory)
A version of
async(Function) that takes a Supplier |
RequestPipeline<InputT,OutputT> |
build(HttpClientDependencies dependencies)
Construct the
RequestPipeline with the currently configured stages. |
static <InputT,OutputT> |
first(Function<HttpClientDependencies,RequestPipeline<InputT,OutputT>> pipelineFactory)
Factory method to create a
RequestPipelineBuilder with an initial pipeline stage. |
static <InputT,OutputT> |
first(Supplier<RequestPipeline<InputT,OutputT>> pipelineFactory)
Factory method to create a
RequestPipelineBuilder with an initial pipeline stage. |
<NewOutputT> |
then(Function<HttpClientDependencies,RequestPipeline<OutputT,NewOutputT>> pipelineFactory)
Factory method to chain the current
RequestPipelineBuilder with another pipeline stage. |
<NewOutputT> |
then(Supplier<RequestPipeline<OutputT,NewOutputT>> pipelineFactory)
Factory method to chain the current
RequestPipelineBuilder with another pipeline stage. |
<NewInputT,NewOutputT> |
wrappedWith(BiFunction<HttpClientDependencies,RequestPipeline<InputT,OutputT>,RequestPipeline<NewInputT,NewOutputT>> wrappedFactory)
Factory method to wrap the current
RequestPipelineBuilder with another pipeline stage. |
<NewInputT,NewOutputT> |
wrappedWith(Function<RequestPipeline<InputT,OutputT>,RequestPipeline<NewInputT,NewOutputT>> wrappedFactory)
Factory method to wrap the current
RequestPipelineBuilder with another pipeline stage. |
public static <InputT,OutputT> RequestPipelineBuilder<InputT,OutputT> first(Function<HttpClientDependencies,RequestPipeline<InputT,OutputT>> pipelineFactory)
RequestPipelineBuilder
with an initial pipeline stage. Stages in this pipeline will only
be able to accept an HttpClientDependencies
or HttpClientDependencies
.InputT
- Input type of pipelineOutputT
- Output type of pipeline.pipelineFactory
- Factory that can produce a RequestPipeline
. Should take an HttpClientDependencies
object as the first parameter to the factory method.build(HttpClientDependencies)
public static <InputT,OutputT> RequestPipelineBuilder<InputT,OutputT> first(Supplier<RequestPipeline<InputT,OutputT>> pipelineFactory)
RequestPipelineBuilder
with an initial pipeline stage. Stages in this pipeline will only
be able to accept an HttpClientDependencies
or HttpClientDependencies
.InputT
- Input type of pipelineOutputT
- Output type of pipeline.pipelineFactory
- Factory that can produce a RequestPipeline
. Use this overload when the factory does not
need HttpClientDependencies
and should instead take no arguments.build(HttpClientDependencies)
public <NewOutputT> RequestPipelineBuilder<InputT,NewOutputT> then(Function<HttpClientDependencies,RequestPipeline<OutputT,NewOutputT>> pipelineFactory)
RequestPipelineBuilder
with another pipeline stage. The new stage's input type
must match the current stage's output type. The new stage may define a new output type (if it's transforming the type) or
may define the same output type as the current stage.NewOutputT
- New output type of pipelinepipelineFactory
- Factory that can produce a RequestPipeline
. Should take an HttpClientDependencies
object as the first parameter to the factory method.build(HttpClientDependencies)
public static <InputT,OutputT> Function<HttpClientDependencies,RequestPipeline<CompletableFuture<InputT>,CompletableFuture<OutputT>>> async(Function<HttpClientDependencies,RequestPipeline<InputT,OutputT>> pipelineFactory)
RequestPipeline
factory into a factory that produces a version of the RequestPipeline
that accepts a CompletableFuture and returns a CompletableFuture.InputT
- the input type of the original RequestPipeline
OutputT
- the return type of the original RequestPipeline
pipelineFactory
- the delegate pipeline factory to wrapRequestPipeline
factorypublic static <InputT,OutputT> Function<HttpClientDependencies,RequestPipeline<CompletableFuture<InputT>,CompletableFuture<OutputT>>> async(Supplier<RequestPipeline<InputT,OutputT>> pipelineFactory)
async(Function)
that takes a Supplier
async(Supplier)
public <NewOutputT> RequestPipelineBuilder<InputT,NewOutputT> then(Supplier<RequestPipeline<OutputT,NewOutputT>> pipelineFactory)
RequestPipelineBuilder
with another pipeline stage. The new stage's input type
must match the current stage's output type. The new stage may define a new output type (if it's transforming the type) or
may define the same output type as the current stage.NewOutputT
- New output type of pipelinepipelineFactory
- Factory that can produce a RequestPipeline
. Use this overload when the factory does not
need HttpClientDependencies
and should instead take no arguments.build(HttpClientDependencies)
public <NewInputT,NewOutputT> RequestPipelineBuilder<NewInputT,NewOutputT> wrappedWith(BiFunction<HttpClientDependencies,RequestPipeline<InputT,OutputT>,RequestPipeline<NewInputT,NewOutputT>> wrappedFactory)
RequestPipelineBuilder
with another pipeline stage. The argument to wrap is a
factory that takes an HttpClientDependencies
object and a inner RequestPipeline
(the current one being
built) as arguments and produces a new RequestPipeline
for the wrapper. The wrapper may have entirely different
input and output types, typically it will have the same however.NewOutputT
- New output type of pipelinewrappedFactory
- BiFunction
factory that can produce a RequestPipeline
. The arguments to the factory
will be HttpClientDependencies
and an inner RequestPipeline
.build(HttpClientDependencies)
public <NewInputT,NewOutputT> RequestPipelineBuilder<NewInputT,NewOutputT> wrappedWith(Function<RequestPipeline<InputT,OutputT>,RequestPipeline<NewInputT,NewOutputT>> wrappedFactory)
RequestPipelineBuilder
with another pipeline stage. The argument is a
factory that takes an inner RequestPipeline
(the current one being built) as an argument and produces a new RequestPipeline
for the wrapper. The wrapper may have entirely different input and output types, typically it will have
the same however.NewOutputT
- New output type of pipelinewrappedFactory
- Function
factory that can produce a RequestPipeline
. The argument to the factory
will be an inner RequestPipeline
.build(HttpClientDependencies)
public RequestPipeline<InputT,OutputT> build(HttpClientDependencies dependencies)
RequestPipeline
with the currently configured stages.dependencies
- HttpClientDependencies
to supply to factory methods that are interested in it.RequestPipeline
.RequestPipeline.execute(Object, RequestExecutionContext)
Copyright © 2020. All rights reserved.