Class ETag


  • public class ETag
    extends Object
    Describes an ETag for a given Token.

    ETag instances are used to perform coarse grained optimistic concurrency checks when making changes to tokens stored in the CTS backing implementation.

    The ETag is generated based on the contents of the entire token and can be used to assert that no part of the token has been changed between requests.

    See Also:
    CTSOptions.ETAG_READ_OPTION, CTSOptions.ETAG_ASSERT_OPTION
    • Method Detail

      • emptyAssertion

        public static ETag emptyAssertion()
        An ETag which does not contain an assertion.

        Use this when you are requesting the ETag value be read by the backing implementation.

        Returns:
        Non null ETag.
      • assertEtag

        public static ETag assertEtag​(String token)
        Create an ETag that asserts the given value.
        Parameters:
        token - Non null string representation of the ETag
        Returns:
        Non null ETag which asserts this value
      • getValue

        public String getValue()
        Returns:
        Non null string representation of this ETag.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object