Record Class ClientHttpRequestFactorySettings
java.lang.Object
java.lang.Record
org.springframework.boot.http.client.ClientHttpRequestFactorySettings
- Record Components:
redirects- the follow redirect strategy to use or null to redirect whenever the underlying library allows itconnectTimeout- the connect timeoutreadTimeout- the read timeoutsslBundle- the SSL bundle providing SSL configuration
public record ClientHttpRequestFactorySettings(ClientHttpRequestFactorySettings.Redirects redirects, Duration connectTimeout, Duration readTimeout, SslBundle sslBundle)
extends Record
Settings that can be applied when creating a
ClientHttpRequestFactory.- Since:
- 3.4.0
- Author:
- Andy Wilkinson, Phillip Webb, Scott Frederick
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumRedirect strategies. -
Constructor Summary
ConstructorsConstructorDescriptionClientHttpRequestFactorySettings(ClientHttpRequestFactorySettings.Redirects redirects, Duration connectTimeout, Duration readTimeout, SslBundle sslBundle) Creates an instance of aClientHttpRequestFactorySettingsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theconnectTimeoutrecord component.defaults()Use defaults for theClientHttpRequestFactorywhich can differ depending on the implementation.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.ofSslBundle(SslBundle sslBundle) Return a newClientHttpRequestFactorySettingsusing defaults for all settings other than the provided SSL bundle.Returns the value of thereadTimeoutrecord component.Returns the value of theredirectsrecord component.Returns the value of thesslBundlerecord component.final StringtoString()Returns a string representation of this record class.withConnectTimeout(Duration connectTimeout) Return a newClientHttpRequestFactorySettingsinstance with an updated connect timeout setting.withReadTimeout(Duration readTimeout) Return a newClientHttpRequestFactorySettingsinstance with an updated read timeout setting.Return a newClientHttpRequestFactorySettingsinstance with an updated redirect setting.withSslBundle(SslBundle sslBundle) Return a newClientHttpRequestFactorySettingsinstance with an updated SSL bundle setting.withTimeouts(Duration connectTimeout, Duration readTimeout) Return a newClientHttpRequestFactorySettingsinstance with an updated connect and read timeout setting.
-
Constructor Details
-
ClientHttpRequestFactorySettings
public ClientHttpRequestFactorySettings(ClientHttpRequestFactorySettings.Redirects redirects, Duration connectTimeout, Duration readTimeout, SslBundle sslBundle) Creates an instance of aClientHttpRequestFactorySettingsrecord class.- Parameters:
redirects- the value for theredirectsrecord componentconnectTimeout- the value for theconnectTimeoutrecord componentreadTimeout- the value for thereadTimeoutrecord componentsslBundle- the value for thesslBundlerecord component
-
-
Method Details
-
withConnectTimeout
Return a newClientHttpRequestFactorySettingsinstance with an updated connect timeout setting.- Parameters:
connectTimeout- the new connect timeout setting- Returns:
- a new
ClientHttpRequestFactorySettingsinstance
-
withReadTimeout
Return a newClientHttpRequestFactorySettingsinstance with an updated read timeout setting.- Parameters:
readTimeout- the new read timeout setting- Returns:
- a new
ClientHttpRequestFactorySettingsinstance
-
withTimeouts
Return a newClientHttpRequestFactorySettingsinstance with an updated connect and read timeout setting.- Parameters:
connectTimeout- the new connect timeout settingreadTimeout- the new read timeout setting- Returns:
- a new
ClientHttpRequestFactorySettingsinstance
-
withSslBundle
Return a newClientHttpRequestFactorySettingsinstance with an updated SSL bundle setting.- Parameters:
sslBundle- the new SSL bundle setting- Returns:
- a new
ClientHttpRequestFactorySettingsinstance
-
withRedirects
public ClientHttpRequestFactorySettings withRedirects(ClientHttpRequestFactorySettings.Redirects redirects) Return a newClientHttpRequestFactorySettingsinstance with an updated redirect setting.- Parameters:
redirects- the new redirects setting- Returns:
- a new
ClientHttpRequestFactorySettingsinstance
-
ofSslBundle
Return a newClientHttpRequestFactorySettingsusing defaults for all settings other than the provided SSL bundle.- Parameters:
sslBundle- the SSL bundle setting- Returns:
- a new
ClientHttpRequestFactorySettingsinstance
-
defaults
Use defaults for theClientHttpRequestFactorywhich can differ depending on the implementation.- Returns:
- default settings
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
redirects
Returns the value of theredirectsrecord component.- Returns:
- the value of the
redirectsrecord component
-
connectTimeout
Returns the value of theconnectTimeoutrecord component.- Returns:
- the value of the
connectTimeoutrecord component
-
readTimeout
Returns the value of thereadTimeoutrecord component.- Returns:
- the value of the
readTimeoutrecord component
-
sslBundle
Returns the value of thesslBundlerecord component.- Returns:
- the value of the
sslBundlerecord component
-