class DefaultServerHttpRequestBuilder extends java.lang.Object implements ServerHttpRequest.Builder
ServerHttpRequest.Builder
.Modifier and Type | Class and Description |
---|---|
private static class |
DefaultServerHttpRequestBuilder.DefaultServerHttpRequest |
Modifier and Type | Field and Description |
---|---|
private <any> |
body |
private java.lang.String |
contextPath |
private MultiValueMap<java.lang.String,HttpCookie> |
cookies |
private HttpHeaders |
httpHeaders |
private java.lang.String |
httpMethodValue |
private ServerHttpRequest |
originalRequest |
private java.net.URI |
uri |
private java.lang.String |
uriPath |
Constructor and Description |
---|
DefaultServerHttpRequestBuilder(ServerHttpRequest original) |
Modifier and Type | Method and Description |
---|---|
ServerHttpRequest |
build()
Build a
ServerHttpRequest decorator with the mutated properties. |
ServerHttpRequest.Builder |
contextPath(java.lang.String contextPath)
Set the contextPath to use.
|
private static <K,V> void |
copyMultiValueMap(MultiValueMap<K,V> source,
MultiValueMap<K,V> destination) |
private java.net.URI |
getUriToUse() |
ServerHttpRequest.Builder |
header(java.lang.String key,
java.lang.String value)
Set or override the specified header.
|
ServerHttpRequest.Builder |
headers(java.util.function.Consumer<HttpHeaders> headersConsumer)
Manipulate this request's headers with the given consumer.
|
ServerHttpRequest.Builder |
method(HttpMethod httpMethod)
Set the HTTP method to return.
|
ServerHttpRequest.Builder |
path(java.lang.String path)
Set the path to use instead of the
"rawPath" of
HttpRequest.getURI() . |
ServerHttpRequest.Builder |
uri(java.net.URI uri)
Set the URI to return.
|
private java.net.URI uri
private HttpHeaders httpHeaders
private java.lang.String httpMethodValue
private final MultiValueMap<java.lang.String,HttpCookie> cookies
@Nullable private java.lang.String uriPath
@Nullable private java.lang.String contextPath
private <any> body
private final ServerHttpRequest originalRequest
public DefaultServerHttpRequestBuilder(ServerHttpRequest original)
private static <K,V> void copyMultiValueMap(MultiValueMap<K,V> source, MultiValueMap<K,V> destination)
public ServerHttpRequest.Builder method(HttpMethod httpMethod)
ServerHttpRequest.Builder
method
in interface ServerHttpRequest.Builder
public ServerHttpRequest.Builder uri(java.net.URI uri)
ServerHttpRequest.Builder
uri
in interface ServerHttpRequest.Builder
public ServerHttpRequest.Builder path(java.lang.String path)
ServerHttpRequest.Builder
"rawPath"
of
HttpRequest.getURI()
.path
in interface ServerHttpRequest.Builder
public ServerHttpRequest.Builder contextPath(java.lang.String contextPath)
ServerHttpRequest.Builder
contextPath
in interface ServerHttpRequest.Builder
public ServerHttpRequest.Builder header(java.lang.String key, java.lang.String value)
ServerHttpRequest.Builder
header
in interface ServerHttpRequest.Builder
public ServerHttpRequest.Builder headers(java.util.function.Consumer<HttpHeaders> headersConsumer)
ServerHttpRequest.Builder
HttpHeaders
methods.headers
in interface ServerHttpRequest.Builder
headersConsumer
- a function that consumes the HttpHeaders
public ServerHttpRequest build()
ServerHttpRequest.Builder
ServerHttpRequest
decorator with the mutated properties.build
in interface ServerHttpRequest.Builder
private java.net.URI getUriToUse()