public class ControllerUtils extends Object
Constructor and Description |
---|
ControllerUtils() |
Modifier and Type | Method and Description |
---|---|
static ResponseEntity<org.springframework.hateoas.RepresentationModel<?>> |
toEmptyResponse(HttpStatus status)
Return an empty response that is only comprised of a status
|
static ResponseEntity<org.springframework.hateoas.RepresentationModel<?>> |
toEmptyResponse(HttpStatus status,
HttpHeaders headers)
Return an empty response that is only comprised of headers and a status
|
static <R extends org.springframework.hateoas.RepresentationModel<?>> |
toResponseEntity(HttpStatus status,
HttpHeaders headers,
Optional<R> resource) |
static <R extends org.springframework.hateoas.RepresentationModel<?>> |
toResponseEntity(HttpStatus status,
HttpHeaders headers,
R resource)
Wrap a resource as a
ResponseEntity and attach given headers and status. |
public static <R extends org.springframework.hateoas.RepresentationModel<?>> ResponseEntity<org.springframework.hateoas.RepresentationModel<?>> toResponseEntity(HttpStatus status, HttpHeaders headers, Optional<R> resource)
public static <R extends org.springframework.hateoas.RepresentationModel<?>> ResponseEntity<org.springframework.hateoas.RepresentationModel<?>> toResponseEntity(HttpStatus status, HttpHeaders headers, R resource)
ResponseEntity
and attach given headers and status.R
- status
- headers
- resource
- public static ResponseEntity<org.springframework.hateoas.RepresentationModel<?>> toEmptyResponse(HttpStatus status)
status
- public static ResponseEntity<org.springframework.hateoas.RepresentationModel<?>> toEmptyResponse(HttpStatus status, HttpHeaders headers)
status
- headers
- Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.