abstract static class DefaultServerResponseBuilder.AbstractServerResponse extends java.lang.Object implements ServerResponse
ServerResponse
implementations.ServerResponse.BodyBuilder, ServerResponse.Context, ServerResponse.HeadersBuilder<B extends ServerResponse.HeadersBuilder<B>>
Modifier and Type | Field and Description |
---|---|
private MultiValueMap<java.lang.String,ResponseCookie> |
cookies |
private HttpHeaders |
headers |
(package private) java.util.Map<java.lang.String,java.lang.Object> |
hints |
private static java.util.Set<HttpMethod> |
SAFE_METHODS |
(package private) int |
statusCode |
Modifier | Constructor and Description |
---|---|
protected |
AbstractServerResponse(int statusCode,
HttpHeaders headers,
MultiValueMap<java.lang.String,ResponseCookie> cookies,
java.util.Map<java.lang.String,java.lang.Object> hints) |
Modifier and Type | Method and Description |
---|---|
MultiValueMap<java.lang.String,ResponseCookie> |
cookies()
Return the cookies of this response.
|
private static <K,V> void |
copy(MultiValueMap<K,V> src,
MultiValueMap<K,V> dst) |
HttpHeaders |
headers()
Return the headers of this response.
|
HttpStatus |
statusCode()
Return the status code of this response.
|
private void |
writeStatusAndHeaders(ServerHttpResponse response) |
<any> |
writeTo(ServerWebExchange exchange,
ServerResponse.Context context)
Write this response to the given web exchange.
|
protected abstract <any> |
writeToInternal(ServerWebExchange exchange,
ServerResponse.Context context) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
accepted, badRequest, created, from, noContent, notFound, ok, permanentRedirect, seeOther, status, status, temporaryRedirect, unprocessableEntity
private static final java.util.Set<HttpMethod> SAFE_METHODS
final int statusCode
private final HttpHeaders headers
private final MultiValueMap<java.lang.String,ResponseCookie> cookies
final java.util.Map<java.lang.String,java.lang.Object> hints
protected AbstractServerResponse(int statusCode, HttpHeaders headers, MultiValueMap<java.lang.String,ResponseCookie> cookies, java.util.Map<java.lang.String,java.lang.Object> hints)
public final HttpStatus statusCode()
ServerResponse
statusCode
in interface ServerResponse
public final HttpHeaders headers()
ServerResponse
headers
in interface ServerResponse
public MultiValueMap<java.lang.String,ResponseCookie> cookies()
ServerResponse
cookies
in interface ServerResponse
public final <any> writeTo(ServerWebExchange exchange, ServerResponse.Context context)
ServerResponse
writeTo
in interface ServerResponse
exchange
- the web exchange to write tocontext
- the context to use when writingMono<Void>
to indicate when writing is completeprivate void writeStatusAndHeaders(ServerHttpResponse response)
protected abstract <any> writeToInternal(ServerWebExchange exchange, ServerResponse.Context context)
private static <K,V> void copy(MultiValueMap<K,V> src, MultiValueMap<K,V> dst)