public class ControllerUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static Iterable<org.springframework.hateoas.EntityModel<?>> |
EMPTY_RESOURCE_LIST
Deprecated.
since 3.3
|
| 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
ResourceEntity and attach given headers and status. |
@Deprecated public static final Iterable<org.springframework.hateoas.EntityModel<?>> EMPTY_RESOURCE_LIST
CollectionModel.empty() instead.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)
ResourceEntity 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–2021 Pivotal Software, Inc.. All rights reserved.