org.springframework.hateoas.mvc
Class HeaderLinksResponseEntity<T extends ResourceSupport>
java.lang.Object
org.springframework.http.HttpEntity<T>
org.springframework.http.ResponseEntity<T>
org.springframework.hateoas.mvc.HeaderLinksResponseEntity<T>
public class HeaderLinksResponseEntity<T extends ResourceSupport>
- extends ResponseEntity<T>
Special 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 Links will not be present in the ResourceSupport instance anymore when ResourceProcessors
kick in.
- Author:
- Oliver Gierke
wrap
public static <S extends ResourceSupport> HeaderLinksResponseEntity<S> wrap(HttpEntity<S> entity)
- Wraps the given
HttpEntity into a HeaderLinksResponseEntity. Will default the status code to
HttpStatus.OK if the given value is not a ResponseEntity.
- Parameters:
entity - must not be null.
- Returns:
Copyright © 2012-2014-2014 Pivotal, Inc.. All Rights Reserved.