Class ETag

All Implemented Interfaces:
Serializable, Cloneable, Header, NameValuePair

@Header("ETag") public class ETag extends BasicEntityTagHeader
Represents a parsed ETag HTTP response header.

An identifier for a specific version of a resource, often a message digest.

Example

ETag: "737060cd8c284d8af7ad3082f209582d"

RFC2616 Specification
The ETag response-header field provides the current value of the entity tag for the requested variant. The headers used with entity tags are described in sections 14.24, 14.26 and 14.44. The entity tag MAY be used for comparison with other entities from the same resource (see section 13.3.3).

ETag = "ETag" ":" entity-tag

Examples:

ETag: "xyzzy" ETag: W/"xyzzy" ETag: ""

See Also:
  • Constructor Details

    • ETag

      public ETag(String value)
      Constructor.
      Parameters:
      value - The header value.
      Must be an entity tag value (e.g. "\"xyzzy\"").
      Can be null.
    • ETag

      public ETag(EntityTag value)
      Constructor.
      Parameters:
      value - The header value.
      Can be null.
    • ETag

      public ETag(Supplier<EntityTag> value)
      Constructor with delayed value.

      Header value is re-evaluated on each call to BasicEntityTagHeader.getValue().

      Parameters:
      value - The supplier of the header value.
      Can be null.
  • Method Details

    • of

      public static ETag of(String value)
      Static creator.
      Parameters:
      value - The header value.
      Must be an entity tag value (e.g. "\"xyzzy\"").
      Can be null.
      Returns:
      A new header bean, or null if the value is null.
    • of

      public static ETag of(EntityTag value)
      Static creator.
      Parameters:
      value - The header value.
      Can be null.
      Returns:
      A new header bean, or null if the value is null.
    • of

      public static ETag of(Supplier<EntityTag> value)
      Static creator with delayed value.

      Header value is re-evaluated on each call to BasicEntityTagHeader.getValue().

      Parameters:
      value - The supplier of the header value.
      Can be null.
      Returns:
      A new header bean, or null if the value is null.