From 4d70b83e801c2a0ccad0fe9d59d30a25d8232cba Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 6 Jul 2023 19:42:17 +0100 Subject: [PATCH] Improve javadoc of ClientHttpRequestFactories Closes gh-36267 --- .../client/ClientHttpRequestFactories.java | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/client/ClientHttpRequestFactories.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/client/ClientHttpRequestFactories.java index 9ce340b6895..96e7b28056e 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/client/ClientHttpRequestFactories.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/client/ClientHttpRequestFactories.java @@ -61,8 +61,14 @@ public final class ClientHttpRequestFactories { } /** - * Return a new {@link ClientHttpRequestFactory} instance using the most appropriate - * implementation. + * Return a {@link ClientHttpRequestFactory} implementation with the given + * {@code settings} applied. The first of the following implementations whose + * dependencies {@link ClassUtils#isPresent are available} is returned: + *
    + *
  1. {@link HttpComponentsClientHttpRequestFactory}
  2. + *
  3. {@link OkHttp3ClientHttpRequestFactory}
  4. + *
  5. {@link SimpleClientHttpRequestFactory}
  6. + *
* @param settings the settings to apply * @return a new {@link ClientHttpRequestFactory} */ @@ -78,8 +84,17 @@ public final class ClientHttpRequestFactories { } /** - * Return a new {@link ClientHttpRequestFactory} of the given type, applying - * {@link ClientHttpRequestFactorySettings} using reflection if necessary. + * Return a new {@link ClientHttpRequestFactory} of the given + * {@code requestFactoryType}, applying {@link ClientHttpRequestFactorySettings} using + * reflection if necessary. The following implementations are supported without the + * use of reflection: + * + * A {@code requestFactoryType} of {@link ClientHttpRequestFactory} is equivalent to + * calling {@link #get(ClientHttpRequestFactorySettings)}. * @param the {@link ClientHttpRequestFactory} type * @param requestFactoryType the {@link ClientHttpRequestFactory} type * @param settings the settings to apply