Class HttpHeadersPreparer
java.lang.Object
org.springframework.data.rest.webmvc.HttpHeadersPreparer
- Author:
- Oliver Gierke, Dario Seidl
-
Constructor Summary
ConstructorsConstructorDescriptionHttpHeadersPreparer(org.springframework.data.auditing.AuditableBeanWrapperFactory auditableBeanWrapperFactory) -
Method Summary
Modifier and TypeMethodDescriptionbooleanisObjectStillValid(Object source, org.springframework.http.HttpHeaders headers) Returns whether the given object is still valid in the context of the givenHttpHeaders' requirements.org.springframework.http.HttpHeadersprepareHeaders(Optional<PersistentEntityResource> resource) Returns the default headers to be returned for the givenPersistentEntityResource.org.springframework.http.HttpHeadersprepareHeaders(org.springframework.data.mapping.PersistentEntity<?, ?> entity, Object value) Returns the default headers to be returned for the givenPersistentEntityand value.
-
Constructor Details
-
HttpHeadersPreparer
public HttpHeadersPreparer(org.springframework.data.auditing.AuditableBeanWrapperFactory auditableBeanWrapperFactory)
-
-
Method Details
-
prepareHeaders
public org.springframework.http.HttpHeaders prepareHeaders(Optional<PersistentEntityResource> resource) Returns the default headers to be returned for the givenPersistentEntityResource. Will setETagandLast-Modifiedheaders if applicable.- Parameters:
resource- can be null.- Returns:
-
prepareHeaders
public org.springframework.http.HttpHeaders prepareHeaders(org.springframework.data.mapping.PersistentEntity<?, ?> entity, Object value) Returns the default headers to be returned for the givenPersistentEntityand value. Will setETagandLast-Modifiedheaders if applicable.- Parameters:
entity- must not be null.value- must not be null.- Returns:
-
isObjectStillValid
Returns whether the given object is still valid in the context of the givenHttpHeaders' requirements.- Parameters:
source- must not be null.headers- must not be null.- Returns:
-