public class HeaderLinksResponseEntity<T extends RepresentationModel<?>> extends ResponseEntity<T>
ResponseEntity that exposes Link instances in the contained RepresentationModel 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 Links will not be present in the RepresentationModel instance anymore when
RepresentationModelProcessors kick in.ResponseEntity.BodyBuilder, ResponseEntity.HeadersBuilder<B extends ResponseEntity.HeadersBuilder<B>>EMPTY| Modifier and Type | Method and Description |
|---|---|
static <S extends RepresentationModel<?>> |
wrap(HttpEntity<S> entity)
Wraps the given
HttpEntity into a HeaderLinksResponseEntity. |
static <S extends RepresentationModel<?>> |
wrap(S entity)
Wraps the given
RepresentationModel into a HeaderLinksResponseEntity. |
accepted, badRequest, created, equals, getStatusCode, getStatusCodeValue, hashCode, noContent, notFound, of, ok, ok, status, status, toString, unprocessableEntitygetBody, getHeaders, hasBodypublic static <S extends RepresentationModel<?>> 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.public static <S extends RepresentationModel<?>> HeaderLinksResponseEntity<S> wrap(S entity)
RepresentationModel into a HeaderLinksResponseEntity. Will default the status code
to HttpStatus.OK.entity - must not be null.Copyright © 2011–2020 Pivotal, Inc.. All rights reserved.