接口 ClientHttpRequestFactoryBuilder<T extends ClientHttpRequestFactory>
- 类型参数:
T- theClientHttpRequestFactorytype
- 所有已知实现类:
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 Tbuild()Build a default configuredClientHttpRequestFactory.build(ClientHttpRequestFactorySettings settings) Build a fully configuredClientHttpRequestFactory, applying the givensettingsif they are provided.static ClientHttpRequestFactoryBuilder<? extends ClientHttpRequestFactory> detect()Detect the most suitableClientHttpRequestFactoryBuilderbased on the classpath.static ClientHttpRequestFactoryBuilder<? extends ClientHttpRequestFactory> detect(ClassLoader classLoader) Detect the most suitableClientHttpRequestFactoryBuilderbased on the classpath.Return aHttpComponentsClientHttpRequestFactoryBuilderthat can be used to build aHttpComponentsClientHttpRequestFactory.jdk()Return aJdkClientHttpRequestFactoryBuilderthat can be used to build aJdkClientHttpRequestFactory.jetty()Return aJettyClientHttpRequestFactoryBuilderthat can be used to build aJettyClientHttpRequestFactory.static <T extends ClientHttpRequestFactory>
ClientHttpRequestFactoryBuilder<T> Return a newClientHttpRequestFactoryBuilderfor the givenrequestFactoryType.static <T extends ClientHttpRequestFactory>
ClientHttpRequestFactoryBuilder<T> Return a newClientHttpRequestFactoryBuilderfrom the given supplier, using reflection to ultimately apply theClientHttpRequestFactorySettings.reactor()Return aReactorClientHttpRequestFactoryBuilderthat can be used to build aReactorClientHttpRequestFactory.simple()Return aSimpleClientHttpRequestFactoryBuilderthat can be used to build aSimpleClientHttpRequestFactory.default ClientHttpRequestFactoryBuilder<T> withCustomizer(Consumer<T> customizer) Return a newClientHttpRequestFactoryBuilderthat applies the given customizer to theClientHttpRequestFactoryafter it has been built.default ClientHttpRequestFactoryBuilder<T> withCustomizers(Collection<Consumer<T>> customizers) Return a newClientHttpRequestFactoryBuilderthat applies the given customizers to theClientHttpRequestFactoryafter it has been built.
-
方法详细资料
-
build
Build a default configuredClientHttpRequestFactory.- 返回:
- a default configured
ClientHttpRequestFactory.
-
build
Build a fully configuredClientHttpRequestFactory, applying the givensettingsif they are provided.- 参数:
settings- the settings to apply ornull- 返回:
- a fully configured
ClientHttpRequestFactory.
-
withCustomizer
Return a newClientHttpRequestFactoryBuilderthat applies the given customizer to theClientHttpRequestFactoryafter it has been built.- 参数:
customizer- the customizers to apply- 返回:
- a new
ClientHttpRequestFactoryBuilderinstance
-
withCustomizers
Return a newClientHttpRequestFactoryBuilderthat applies the given customizers to theClientHttpRequestFactoryafter it has been built.- 参数:
customizers- the customizers to apply- 返回:
- a new
ClientHttpRequestFactoryBuilderinstance
-
httpComponents
Return aHttpComponentsClientHttpRequestFactoryBuilderthat can be used to build aHttpComponentsClientHttpRequestFactory. -
jetty
Return aJettyClientHttpRequestFactoryBuilderthat can be used to build aJettyClientHttpRequestFactory.- 返回:
- a new
JettyClientHttpRequestFactoryBuilder
-
reactor
Return aReactorClientHttpRequestFactoryBuilderthat can be used to build aReactorClientHttpRequestFactory.- 返回:
- a new
ReactorClientHttpRequestFactoryBuilder
-
jdk
Return aJdkClientHttpRequestFactoryBuilderthat can be used to build aJdkClientHttpRequestFactory.- 返回:
- a new
JdkClientHttpRequestFactoryBuilder
-
simple
Return aSimpleClientHttpRequestFactoryBuilderthat can be used to build aSimpleClientHttpRequestFactory.- 返回:
- a new
SimpleClientHttpRequestFactoryBuilder
-
of
static <T extends ClientHttpRequestFactory> ClientHttpRequestFactoryBuilder<T> of(Class<T> requestFactoryType) Return a newClientHttpRequestFactoryBuilderfor the givenrequestFactoryType. The following implementations are supported without the use of reflection:- 类型参数:
T- theClientHttpRequestFactorytype- 参数:
requestFactoryType- theClientHttpRequestFactorytype- 返回:
- a new
ClientHttpRequestFactoryBuilder
-
of
static <T extends ClientHttpRequestFactory> ClientHttpRequestFactoryBuilder<T> of(Supplier<T> requestFactorySupplier) Return a newClientHttpRequestFactoryBuilderfrom the given supplier, using reflection to ultimately apply theClientHttpRequestFactorySettings.- 类型参数:
T- theClientHttpRequestFactorytype- 参数:
requestFactorySupplier- theClientHttpRequestFactorysupplier- 返回:
- a new
ClientHttpRequestFactoryBuilder
-
detect
Detect the most suitableClientHttpRequestFactoryBuilderbased on the classpath. The method favors builders in the following order:- 返回:
- the most suitable
ClientHttpRequestFactoryBuilderfor the classpath
-
detect
static ClientHttpRequestFactoryBuilder<? extends ClientHttpRequestFactory> detect(ClassLoader classLoader) Detect the most suitableClientHttpRequestFactoryBuilderbased on the classpath. The method favors builders in the following order:- 参数:
classLoader- the class loader to use for detection- 返回:
- the most suitable
ClientHttpRequestFactoryBuilderfor the classpath - 从以下版本开始:
- 3.5.0
-