Class ReactiveHttpRequestValues.Builder
java.lang.Object
org.springframework.web.service.invoker.HttpRequestValues.Builder
org.springframework.web.service.invoker.ReactiveHttpRequestValues.Builder
- All Implemented Interfaces:
HttpRequestValues.Metadata
- Enclosing class:
- ReactiveHttpRequestValues
Builder for
ReactiveHttpRequestValues
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddAttribute
(String name, Object value) Configure an attribute to associate with the request.Add the given cookie name and values.Add the given header name and values.addRequestParameter
(String name, String... values) Add the given request parameter name and values.addRequestPart
(String name, Object part) Add a part to a multipart request.<T,
P extends Publisher<T>>
ReactiveHttpRequestValues.BuilderaddRequestPartPublisher
(String name, P publisher, ParameterizedTypeReference<T> elementTye) Variant ofaddRequestPart(String, Object)
that allows the part value to be produced by aPublisher
.build()
Build theHttpRequestValues
instance.protected Object
protected ReactiveHttpRequestValues
createRequestValues
(HttpMethod httpMethod, URI uri, UriBuilderFactory uriBuilderFactory, String uriTemplate, Map<String, String> uriVars, HttpHeaders headers, MultiValueMap<String, String> cookies, Map<String, Object> attributes, Object bodyValue) CreateHttpRequestValues
from values passed to theHttpRequestValues.Builder
.protected boolean
hasBody()
protected boolean
hasParts()
Set the media types for the requestAccept
header.<T,
P extends Publisher<T>>
voidsetBodyPublisher
(P body, ParameterizedTypeReference<T> elementTye) Set the request body as a Reactive StreamsPublisher
.void
setBodyValue
(Object bodyValue) Set the request body as an Object to be serialized.setContentType
(MediaType contentType) Set the media type for the requestContent-Type
header.setHttpMethod
(HttpMethod httpMethod) Set the HTTP method for the request.Set the URL to use.setUriBuilderFactory
(UriBuilderFactory uriBuilderFactory) Set theUriBuilderFactory
that will be used to expand theHttpRequestValues.Builder.getUriTemplate()
.setUriTemplate
(String uriTemplate) Set the request URL as a String template.setUriVariable
(String name, String value) Add a URI variable name-value pair.Methods inherited from class org.springframework.web.service.invoker.HttpRequestValues.Builder
getAcceptMediaTypes, getContentType, getHttpMethod, getUriTemplate
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
setHttpMethod
Description copied from class:HttpRequestValues.Builder
Set the HTTP method for the request.- Overrides:
setHttpMethod
in classHttpRequestValues.Builder
-
setUri
Description copied from class:HttpRequestValues.Builder
Set the URL to use. When set, this overrides the URI template from theHttpExchange
annotation.- Overrides:
setUri
in classHttpRequestValues.Builder
-
setUriBuilderFactory
public ReactiveHttpRequestValues.Builder setUriBuilderFactory(@Nullable UriBuilderFactory uriBuilderFactory) Description copied from class:HttpRequestValues.Builder
Set theUriBuilderFactory
that will be used to expand theHttpRequestValues.Builder.getUriTemplate()
.- Overrides:
setUriBuilderFactory
in classHttpRequestValues.Builder
-
setUriTemplate
Description copied from class:HttpRequestValues.Builder
Set the request URL as a String template.- Overrides:
setUriTemplate
in classHttpRequestValues.Builder
-
setUriVariable
Description copied from class:HttpRequestValues.Builder
Add a URI variable name-value pair.- Overrides:
setUriVariable
in classHttpRequestValues.Builder
-
setAccept
Description copied from class:HttpRequestValues.Builder
Set the media types for the requestAccept
header.- Overrides:
setAccept
in classHttpRequestValues.Builder
-
setContentType
Description copied from class:HttpRequestValues.Builder
Set the media type for the requestContent-Type
header.- Overrides:
setContentType
in classHttpRequestValues.Builder
-
addHeader
Description copied from class:HttpRequestValues.Builder
Add the given header name and values.- Overrides:
addHeader
in classHttpRequestValues.Builder
-
addCookie
Description copied from class:HttpRequestValues.Builder
Add the given cookie name and values.- Overrides:
addCookie
in classHttpRequestValues.Builder
-
addRequestParameter
Description copied from class:HttpRequestValues.Builder
Add the given request parameter name and values.When
"content-type"
is set to"application/x-www-form-urlencoded"
, request parameters are encoded in the request body. Otherwise, they are added as URL query parameters.- Overrides:
addRequestParameter
in classHttpRequestValues.Builder
-
addAttribute
Description copied from class:HttpRequestValues.Builder
Configure an attribute to associate with the request.- Overrides:
addAttribute
in classHttpRequestValues.Builder
- Parameters:
name
- the attribute namevalue
- the attribute value
-
addRequestPart
Add a part to a multipart request. The part value may be as described inMultipartBodyBuilder.part(String, Object)
.- Overrides:
addRequestPart
in classHttpRequestValues.Builder
-
addRequestPartPublisher
public <T,P extends Publisher<T>> ReactiveHttpRequestValues.Builder addRequestPartPublisher(String name, P publisher, ParameterizedTypeReference<T> elementTye) Variant ofaddRequestPart(String, Object)
that allows the part value to be produced by aPublisher
. -
setBodyValue
Set the request body as an Object to be serialized.This is mutually exclusive with and resets any previously set body publisher.
- Overrides:
setBodyValue
in classHttpRequestValues.Builder
-
setBodyPublisher
public <T,P extends Publisher<T>> void setBodyPublisher(P body, ParameterizedTypeReference<T> elementTye) Set the request body as a Reactive StreamsPublisher
.This is mutually exclusive with and resets any previously set body value.
-
build
Description copied from class:HttpRequestValues.Builder
Build theHttpRequestValues
instance.- Overrides:
build
in classHttpRequestValues.Builder
-
hasParts
protected boolean hasParts()- Overrides:
hasParts
in classHttpRequestValues.Builder
-
hasBody
protected boolean hasBody()- Overrides:
hasBody
in classHttpRequestValues.Builder
-
buildMultipartBody
- Overrides:
buildMultipartBody
in classHttpRequestValues.Builder
-
createRequestValues
protected ReactiveHttpRequestValues createRequestValues(@Nullable HttpMethod httpMethod, @Nullable URI uri, @Nullable UriBuilderFactory uriBuilderFactory, @Nullable String uriTemplate, Map<String, String> uriVars, HttpHeaders headers, MultiValueMap<String, String> cookies, Map<String, Object> attributes, @Nullable Object bodyValue) Description copied from class:HttpRequestValues.Builder
CreateHttpRequestValues
from values passed to theHttpRequestValues.Builder
.- Overrides:
createRequestValues
in classHttpRequestValues.Builder
-