public class HeaderLinksResponseEntity<T extends ResourceSupport> extends ResponseEntity<T>
ResponseEntity
that exposes Link
instances in the contained ResourceSupport
as link
headers instead of in the body. Note, that this class is not intended to be used directly from user code but by
support code that will transparently invoke the header exposure. If you use this class from a controller directly,
the Link
s will not be present in the ResourceSupport
instance anymore when ResourceProcessor
s
kick in.ResponseEntity.BodyBuilder, ResponseEntity.HeadersBuilder<B extends ResponseEntity.HeadersBuilder<B>>
EMPTY
Modifier and Type | Method and Description |
---|---|
static <S extends ResourceSupport> |
wrap(HttpEntity<S> entity)
Wraps the given
HttpEntity into a HeaderLinksResponseEntity . |
accepted, badRequest, created, equals, getStatusCode, getStatusCodeValue, hashCode, noContent, notFound, ok, ok, status, status, toString, unprocessableEntity
getBody, getHeaders, hasBody
public static <S extends ResourceSupport> HeaderLinksResponseEntity<S> wrap(HttpEntity<S> entity)
HttpEntity
into a HeaderLinksResponseEntity
. Will default the status code to
HttpStatus.OK
if the given value is not a ResponseEntity
.entity
- must not be null.Copyright © 2012-2016–2018 Pivotal, Inc.. All rights reserved.