接口 ClientHttpRequestFactoryBuilder<T extends ClientHttpRequestFactory>
- 类型参数:
T
- theClientHttpRequestFactory
type
- 所有已知实现类:
HttpComponentsClientHttpRequestFactoryBuilder
,JdkClientHttpRequestFactoryBuilder
,JettyClientHttpRequestFactoryBuilder
,ReactorClientHttpRequestFactoryBuilder
,SimpleClientHttpRequestFactoryBuilder
- 函数接口:
- 这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。
@FunctionalInterface
public interface ClientHttpRequestFactoryBuilder<T extends ClientHttpRequestFactory>
Interface used to build a fully configured
ClientHttpRequestFactory
. Builders
for Apache HTTP Components
, Jetty
,
Reactor
, JDK
and simple client
can
be obtained using the factory methods on this interface. The of(Class)
and
of(Supplier)
methods may be used to instantiate other
ClientHttpRequestFactory
instances using reflection.- 从以下版本开始:
- 3.4.0
- 作者:
- Phillip Webb
-
方法概要
修饰符和类型方法说明default T
build()
Build a default configuredClientHttpRequestFactory
.build
(ClientHttpRequestFactorySettings settings) Build a fully configuredClientHttpRequestFactory
, applying the givensettings
if they are provided.static ClientHttpRequestFactoryBuilder
<? extends ClientHttpRequestFactory> detect()
Detect the most suitableClientHttpRequestFactoryBuilder
based on the classpath.Return aHttpComponentsClientHttpRequestFactoryBuilder
that can be used to build aHttpComponentsClientHttpRequestFactory
.jdk()
Return aJdkClientHttpRequestFactoryBuilder
that can be used to build aJdkClientHttpRequestFactory
.jetty()
Return aJettyClientHttpRequestFactoryBuilder
that can be used to build aJettyClientHttpRequestFactory
.static <T extends ClientHttpRequestFactory>
ClientHttpRequestFactoryBuilder<T> Return a newClientHttpRequestFactoryBuilder
for the givenrequestFactoryType
.static <T extends ClientHttpRequestFactory>
ClientHttpRequestFactoryBuilder<T> Return a newClientHttpRequestFactoryBuilder
from the given supplier, using reflection to ultimately apply theClientHttpRequestFactorySettings
.reactor()
Return aReactorClientHttpRequestFactoryBuilder
that can be used to build aReactorClientHttpRequestFactory
.simple()
Return aSimpleClientHttpRequestFactoryBuilder
that can be used to build aSimpleClientHttpRequestFactory
.default ClientHttpRequestFactoryBuilder
<T> withCustomizer
(Consumer<T> customizer) Return a newClientHttpRequestFactoryBuilder
that applies the given customizer to theClientHttpRequestFactory
after it has been built.default ClientHttpRequestFactoryBuilder
<T> withCustomizers
(Collection<Consumer<T>> customizers) Return a newClientHttpRequestFactoryBuilder
that applies the given customizers to theClientHttpRequestFactory
after it has been built.
-
方法详细资料
-
build
Build a default configuredClientHttpRequestFactory
.- 返回:
- a default configured
ClientHttpRequestFactory
.
-
build
Build a fully configuredClientHttpRequestFactory
, applying the givensettings
if they are provided.- 参数:
settings
- the settings to apply ornull
- 返回:
- a fully configured
ClientHttpRequestFactory
.
-
withCustomizer
Return a newClientHttpRequestFactoryBuilder
that applies the given customizer to theClientHttpRequestFactory
after it has been built.- 参数:
customizer
- the customizers to apply- 返回:
- a new
ClientHttpRequestFactoryBuilder
instance
-
withCustomizers
Return a newClientHttpRequestFactoryBuilder
that applies the given customizers to theClientHttpRequestFactory
after it has been built.- 参数:
customizers
- the customizers to apply- 返回:
- a new
ClientHttpRequestFactoryBuilder
instance
-
httpComponents
Return aHttpComponentsClientHttpRequestFactoryBuilder
that can be used to build aHttpComponentsClientHttpRequestFactory
. -
jetty
Return aJettyClientHttpRequestFactoryBuilder
that can be used to build aJettyClientHttpRequestFactory
.- 返回:
- a new
JettyClientHttpRequestFactoryBuilder
-
reactor
Return aReactorClientHttpRequestFactoryBuilder
that can be used to build aReactorClientHttpRequestFactory
.- 返回:
- a new
ReactorClientHttpRequestFactoryBuilder
-
jdk
Return aJdkClientHttpRequestFactoryBuilder
that can be used to build aJdkClientHttpRequestFactory
.- 返回:
- a new
JdkClientHttpRequestFactoryBuilder
-
simple
Return aSimpleClientHttpRequestFactoryBuilder
that can be used to build aSimpleClientHttpRequestFactory
.- 返回:
- a new
SimpleClientHttpRequestFactoryBuilder
-
of
static <T extends ClientHttpRequestFactory> ClientHttpRequestFactoryBuilder<T> of(Class<T> requestFactoryType) Return a newClientHttpRequestFactoryBuilder
for the givenrequestFactoryType
. The following implementations are supported without the use of reflection:- 类型参数:
T
- theClientHttpRequestFactory
type- 参数:
requestFactoryType
- theClientHttpRequestFactory
type- 返回:
- a new
ClientHttpRequestFactoryBuilder
-
of
static <T extends ClientHttpRequestFactory> ClientHttpRequestFactoryBuilder<T> of(Supplier<T> requestFactorySupplier) Return a newClientHttpRequestFactoryBuilder
from the given supplier, using reflection to ultimately apply theClientHttpRequestFactorySettings
.- 类型参数:
T
- theClientHttpRequestFactory
type- 参数:
requestFactorySupplier
- theClientHttpRequestFactory
supplier- 返回:
- a new
ClientHttpRequestFactoryBuilder
-
detect
Detect the most suitableClientHttpRequestFactoryBuilder
based on the classpath. The methods favors builders in the following order:- 返回:
- the most suitable
ClientHttpRequestFactoryBuilder
for the classpath
-