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 Summary
Modifier and Type Method Description longcas()The last-known CAS value for theDocument(0 if not set).Tcontent()The content of theDocument.static <T> EntityDocument<T>create(String id, int expiry, T content)static <T> EntityDocument<T>create(String id, int expiry, T content, long cas)static <T> EntityDocument<T>create(String id, int expiry, T content, long cas, MutationToken mutationToken)static <T> EntityDocument<T>create(String id, T content)static <T> EntityDocument<T>create(String id, T content, long cas)static <T> EntityDocument<T>create(T content)booleanequals(Object o)intexpiry()The optional expiration time for theDocument(0 if not set).inthashCode()Stringid()The per-bucket unique ID of theDocument.MutationTokenmutationToken()The optional, opaque mutation token set after a successful mutation and if enabled on the environment.StringtoString()
-
Method Details
-
id
Description copied from interface:DocumentThe per-bucket unique ID of theDocument. -
content
Description copied from interface:DocumentThe content of theDocument. -
cas
public long cas()Description copied from interface:DocumentThe last-known CAS value for theDocument(0 if not set). -
expiry
public int expiry()Description copied from interface:DocumentThe optional expiration time for theDocument(0 if not set). -
mutationToken
Description copied from interface:DocumentThe 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:
mutationTokenin interfaceDocument<T>- Returns:
- the mutation token if set, otherwise null.
-
toString
-
equals
-
hashCode
public int hashCode() -
create
-
create
-
create
-
create
-
create
-
create
public static <T> EntityDocument<T> create(String id, int expiry, T content, long cas, MutationToken mutationToken)
-