Granting Keith's wish
This commit is contained in:
parent
0485f15998
commit
b67da6c3f8
|
|
@ -66,7 +66,7 @@ public class HttpEntity<T> {
|
|||
/**
|
||||
* Create a new, empty {@code HttpEntity}.
|
||||
*/
|
||||
private HttpEntity() {
|
||||
protected HttpEntity() {
|
||||
this(null, null);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,8 +28,7 @@ import org.springframework.util.MultiValueMap;
|
|||
* MediaType contentType = entity.getHeaders().getContentType();
|
||||
* HttpStatus statusCode = entity.getStatusCode();
|
||||
* </pre>
|
||||
* Can also be used in Spring MVC, as a return value from a @Controller method:
|
||||
* <p>Can be used in Spring MVC, as a return value from a @Controller method:
|
||||
* <p>Can also be used in Spring MVC, as a return value from a @Controller method:
|
||||
* <pre class="code">
|
||||
* @RequestMapping("/handle")
|
||||
* public ResponseEntity<String> handle() {
|
||||
|
|
@ -47,6 +46,15 @@ public class ResponseEntity<T> extends HttpEntity<T> {
|
|||
|
||||
private final HttpStatus statusCode;
|
||||
|
||||
/**
|
||||
* Create a new {@code ResponseEntity} with the given status code, and no body nor headers.
|
||||
* @param statusCode the status code
|
||||
*/
|
||||
public ResponseEntity(HttpStatus statusCode) {
|
||||
super();
|
||||
this.statusCode = statusCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new {@code ResponseEntity} with the given body and status code, and no headers.
|
||||
* @param body the entity body
|
||||
|
|
|
|||
Loading…
Reference in New Issue