Class EntityDocument<T>

java.lang.Object
com.couchbase.client.java.document.EntityDocument<T>
All Implemented Interfaces:
Document<T>

@Public
@Uncommitted
public class EntityDocument<T>
extends Object
implements Document<T>
The entity document is used to carry enclosed entities for the repository implementation.
Since:
1.2.0
Author:
Michael Nitschinger
  • Method Details

    • id

      public String id()
      Description copied from interface: Document
      The per-bucket unique ID of the Document.
      Specified by:
      id in interface Document<T>
      Returns:
      the document id.
    • content

      public T content()
      Description copied from interface: Document
      The content of the Document.
      Specified by:
      content in interface Document<T>
      Returns:
      the content.
    • cas

      public long cas()
      Description copied from interface: Document
      The last-known CAS value for the Document (0 if not set).
      Specified by:
      cas in interface Document<T>
      Returns:
      the CAS value if set.
    • expiry

      public int expiry()
      Description copied from interface: Document
      The optional expiration time for the Document (0 if not set).
      Specified by:
      expiry in interface Document<T>
      Returns:
      the expiration time.
    • mutationToken

      public MutationToken mutationToken()
      Description copied from interface: Document
      The optional, opaque mutation token set after a successful mutation and if enabled on the environment. Note that the mutation token is always null, unless they are explicitly enabled on the environment, the server version is supported (>= 4.0.0) and the mutation operation succeeded. If set, it can be used for enhanced durability requirements, as well as optimized consistency for N1QL queries.
      Specified by:
      mutationToken in interface Document<T>
      Returns:
      the mutation token if set, otherwise null.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals​(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • create

      public static <T> EntityDocument<T> create​(T content)
    • create

      public static <T> EntityDocument<T> create​(String id, T content)
    • create

      public static <T> EntityDocument<T> create​(String id, int expiry, T content)
    • create

      public static <T> EntityDocument<T> create​(String id, T content, long cas)
    • create

      public static <T> EntityDocument<T> create​(String id, int expiry, T content, long cas)
    • create

      public static <T> EntityDocument<T> create​(String id, int expiry, T content, long cas, MutationToken mutationToken)