@ -62,7 +62,7 @@ public abstract class AbstractServerHttpResponse implements ServerHttpResponse {
@@ -62,7 +62,7 @@ public abstract class AbstractServerHttpResponse implements ServerHttpResponse {
private final DataBufferFactory dataBufferFactory ;
@Nullable
private HttpStatus statusCode ;
private Integer statusCode ;
private final HttpHeaders headers ;
@ -96,7 +96,7 @@ public abstract class AbstractServerHttpResponse implements ServerHttpResponse {
@@ -96,7 +96,7 @@ public abstract class AbstractServerHttpResponse implements ServerHttpResponse {
return false ;
}
else {
this . statusCode = statusCode ;
this . statusCode = ( statusCode ! = null ? statusCode . value ( ) : null ) ;
return true ;
}
}
@ -104,6 +104,25 @@ public abstract class AbstractServerHttpResponse implements ServerHttpResponse {
@@ -104,6 +104,25 @@ public abstract class AbstractServerHttpResponse implements ServerHttpResponse {
@Override
@Nullable
public HttpStatus getStatusCode ( ) {
return ( this . statusCode ! = null ? HttpStatus . resolve ( this . statusCode ) : null ) ;
}
/ * *
* Set the HTTP status code of the response .
* @param statusCode the HTTP status as an integer value
* @since 5 . 0 . 1
* /
public void setStatusCodeValue ( Integer statusCode ) {
this . statusCode = statusCode ;
}
/ * *
* Return the HTTP status code of the response .
* @return the HTTP status as an integer value
* @since 5 . 0 . 1
* /
@Nullable
public Integer getStatusCodeValue ( ) {
return this . statusCode ;
}
@ -121,7 +140,7 @@ public abstract class AbstractServerHttpResponse implements ServerHttpResponse {
@@ -121,7 +140,7 @@ public abstract class AbstractServerHttpResponse implements ServerHttpResponse {
@Override
public void addCookie ( ResponseCookie cookie ) {
Assert . notNull ( cookie , "'cookie' must not be null" ) ;
Assert . notNull ( cookie , "ResponseCookie must not be null" ) ;
if ( this . state . get ( ) = = State . COMMITTED ) {
throw new IllegalStateException ( "Can't add the cookie " + cookie +