private static class RequestPredicates.SubPathServerRequestWrapper extends java.lang.Object implements ServerRequest
ServerRequest.Headers
Modifier and Type | Field and Description |
---|---|
private ServerRequest |
request |
private java.lang.String |
subPath |
Constructor and Description |
---|
SubPathServerRequestWrapper(ServerRequest request,
java.lang.String subPath) |
Modifier and Type | Method and Description |
---|---|
<T> java.util.Optional<T> |
attribute(java.lang.String name)
Return the request attribute value if present.
|
java.util.Map<java.lang.String,java.lang.Object> |
attributes()
Return a mutable map of request attributes.
|
<T> T |
body(BodyExtractor<T,? super ServerHttpRequest> extractor)
Extract the body with the given
BodyExtractor . |
<T> T |
body(BodyExtractor<T,? super ServerHttpRequest> extractor,
java.util.Map<java.lang.String,java.lang.Object> hints)
Extract the body with the given
BodyExtractor and hints. |
<T> <any> |
bodyToFlux(java.lang.Class<? extends T> elementClass)
Extract the body to a
Flux . |
<T> <any> |
bodyToMono(java.lang.Class<? extends T> elementClass)
Extract the body to a
Mono . |
ServerRequest.Headers |
headers()
Return the headers of this request.
|
HttpMethod |
method()
Return the HTTP method.
|
java.lang.String |
path()
Return the request path.
|
java.lang.String |
pathVariable(java.lang.String name)
Return the path variable with the given name, if present.
|
java.util.Map<java.lang.String,java.lang.String> |
pathVariables()
Return all path variables.
|
java.util.Optional<java.lang.String> |
queryParam(java.lang.String name)
Return the first query parameter with the given name, if present.
|
java.util.List<java.lang.String> |
queryParams(java.lang.String name)
Return all query parameter with the given name.
|
<any> |
session()
Return the web session for the current request.
|
java.lang.String |
toString() |
java.net.URI |
uri()
Return the request URI.
|
private final ServerRequest request
private final java.lang.String subPath
public SubPathServerRequestWrapper(ServerRequest request, java.lang.String subPath)
public HttpMethod method()
ServerRequest
method
in interface ServerRequest
public java.net.URI uri()
ServerRequest
uri
in interface ServerRequest
public java.lang.String path()
ServerRequest
path
in interface ServerRequest
public ServerRequest.Headers headers()
ServerRequest
headers
in interface ServerRequest
public <T> T body(BodyExtractor<T,? super ServerHttpRequest> extractor)
ServerRequest
BodyExtractor
.body
in interface ServerRequest
T
- the type of the body returnedextractor
- the BodyExtractor
that reads from the requestServerRequest.body(BodyExtractor, Map)
public <T> T body(BodyExtractor<T,? super ServerHttpRequest> extractor, java.util.Map<java.lang.String,java.lang.Object> hints)
ServerRequest
BodyExtractor
and hints.body
in interface ServerRequest
T
- the type of the body returnedextractor
- the BodyExtractor
that reads from the requesthints
- the map of hints like AbstractJackson2Codec.JSON_VIEW_HINT
to use to customize body extractionpublic <T> <any> bodyToMono(java.lang.Class<? extends T> elementClass)
ServerRequest
Mono
.bodyToMono
in interface ServerRequest
T
- the element typeelementClass
- the class of element in the Mono
public <T> <any> bodyToFlux(java.lang.Class<? extends T> elementClass)
ServerRequest
Flux
.bodyToFlux
in interface ServerRequest
T
- the element typeelementClass
- the class of element in the Flux
public <T> java.util.Optional<T> attribute(java.lang.String name)
ServerRequest
attribute
in interface ServerRequest
T
- the attribute typename
- the attribute namepublic java.util.Map<java.lang.String,java.lang.Object> attributes()
ServerRequest
attributes
in interface ServerRequest
public java.util.Optional<java.lang.String> queryParam(java.lang.String name)
ServerRequest
queryParam
in interface ServerRequest
name
- the parameter namepublic java.util.List<java.lang.String> queryParams(java.lang.String name)
ServerRequest
Returns an empty list if no values could be found.
queryParams
in interface ServerRequest
name
- the parameter namepublic java.lang.String pathVariable(java.lang.String name)
ServerRequest
pathVariable
in interface ServerRequest
name
- the variable namepublic java.util.Map<java.lang.String,java.lang.String> pathVariables()
ServerRequest
pathVariables
in interface ServerRequest
public <any> session()
ServerRequest
session
in interface ServerRequest
public java.lang.String toString()
toString
in class java.lang.Object