Class HttpHeadersPreparer

java.lang.Object
org.springframework.data.rest.webmvc.HttpHeadersPreparer

public class HttpHeadersPreparer extends Object
Value object to prepare HttpHeaders for PersistentEntityResource and PersistentEntity instances.
Author:
Oliver Gierke, Dario Seidl
  • Constructor Details

  • Method Details

    • prepareHeaders

      public HttpHeaders prepareHeaders(Optional<PersistentEntityResource> resource)
      Returns the default headers to be returned for the given PersistentEntityResource. Will set ETag and Last-Modified headers if applicable.
      Parameters:
      resource - can be null.
      Returns:
    • prepareHeaders

      public HttpHeaders prepareHeaders(PersistentEntity<?,?> entity, Object value)
      Returns the default headers to be returned for the given PersistentEntity and value. Will set ETag and Last-Modified headers if applicable.
      Parameters:
      entity - must not be null.
      value - must not be null.
      Returns:
    • isObjectStillValid

      public boolean isObjectStillValid(Object source, HttpHeaders headers)
      Returns whether the given object is still valid in the context of the given HttpHeaders' requirements.
      Parameters:
      source - must not be null.
      headers - must not be null.
      Returns: