Top Description Inners Fields Constructors Methods
org.springframework.web.servlet.function

pack-priv Class DefaultServerRequestBuilder

extends Object
implements Builder
Class Inheritance
All Implemented Interfaces
org.springframework.web.servlet.function.ServerRequest.Builder
Imports
java.io.ByteArrayInputStream, .IOException, .InputStream, java.lang.reflect.Type, java.net.InetSocketAddress, .URI, java.nio.charset.StandardCharsets, java.security.Principal, java.util.ArrayList, .Collections, .LinkedHashMap, .List, .Map, .Optional, java.util.function.Consumer, java.util.stream.Collectors, jakarta.servlet.ReadListener, .ServletException, .ServletInputStream, jakarta.servlet.http.Cookie, .HttpServletRequest, .HttpSession, .Part, org.springframework.core.ParameterizedTypeReference, .ResolvableType, org.springframework.http.HttpHeaders, .HttpInputMessage, .HttpMethod, .MediaType, org.springframework.http.converter.GenericHttpMessageConverter, .HttpMessageConverter, org.springframework.lang.Nullable, org.springframework.util.Assert, .LinkedMultiValueMap, .MultiValueMap, org.springframework.validation.BindException, .BindingResult, org.springframework.web.HttpMediaTypeNotSupportedException, org.springframework.web.bind.ServletRequestDataBinder, .WebDataBinder, org.springframework.web.util.UriBuilder, .UriComponentsBuilder

Default ServerRequest.Builder implementation.
Author
Arjen Poutsma
Since
5.2

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class

Field Summary

Modifier and TypeField and Description
private final Map<String, Object>
private byte[]
private final MultiValueMap<String, Cookie>
private final HttpHeaders
private final List<HttpMessageConverter<?>>
private HttpMethod
private final MultiValueMap<String, String>
private InetSocketAddress
private final HttpServletRequest
private URI

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public ServerRequest.Builder
attribute(String
the attribute name
name
,
Object
the attribute value
value
)

Implements org.springframework.web.servlet.function.ServerRequest.Builder.attribute.

Add an attribute with the given name and value.

public ServerRequest.Builder
attributes(Consumer<Map<String, Object>>
a function that consumes the attributes map
attributesConsumer
)

Implements org.springframework.web.servlet.function.ServerRequest.Builder.attributes.

Manipulate this request's attributes with the given consumer.

public ServerRequest.Builder
body(byte[]
the new body
body
)

Implements org.springframework.web.servlet.function.ServerRequest.Builder.body.

Set the body of the request.

public ServerRequest.Builder
body(String
the new body
body
)

Implements org.springframework.web.servlet.function.ServerRequest.Builder.body.

Set the body of the request to the UTF-8 encoded bytes of the given string.

public ServerRequest
public ServerRequest.Builder
cookies(Consumer<MultiValueMap<String, Cookie>>
a function that consumes the cookies map
cookiesConsumer
)

Implements org.springframework.web.servlet.function.ServerRequest.Builder.cookies.

Manipulate this request's cookies with the given consumer.

public ServerRequest.Builder
header(String
the header name
headerName
,
String...
the header value(s)
headerValues
)

Implements org.springframework.web.servlet.function.ServerRequest.Builder.header.

Add the given header value(s) under the given name.

public ServerRequest.Builder
headers(Consumer<HttpHeaders>
a function that consumes the HttpHeaders
headersConsumer
)

Implements org.springframework.web.servlet.function.ServerRequest.Builder.headers.

Manipulate this request's headers with the given consumer.

public ServerRequest.Builder
method(HttpMethod
the new method
method
)

Implements org.springframework.web.servlet.function.ServerRequest.Builder.method.

Set the method of the request.

public ServerRequest.Builder
param(String
the parameter name
name
,
String...
the parameter value(s)
values
)

Implements org.springframework.web.servlet.function.ServerRequest.Builder.param.

Add a parameter with the given name and value.

public ServerRequest.Builder
params(Consumer<MultiValueMap<String, String>>
a function that consumes the parameters map
paramsConsumer
)

Implements org.springframework.web.servlet.function.ServerRequest.Builder.params.

Manipulate this request's parameters with the given consumer.

public ServerRequest.Builder
remoteAddress(InetSocketAddress
the remote address
remoteAddress
)

Implements org.springframework.web.servlet.function.ServerRequest.Builder.remoteAddress.

Set the remote address of the request.

public ServerRequest.Builder
uri(URI
the new URI
uri
)

Implements org.springframework.web.servlet.function.ServerRequest.Builder.uri.

Set the URI of the request.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait