@InterfaceAudience.Public @InterfaceStability.Uncommitted public class EntityDocument<T> extends Object implements Document<T>
The entity document is used to carry enclosed entities for the repository implementation.
| Modifier and Type | Method and Description |
|---|---|
long |
cas()
The last-known CAS value for the
Document (0 if not set). |
T |
content()
The content of the
Document. |
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) |
boolean |
equals(Object o) |
int |
expiry()
The optional expiration time for the
Document (0 if not set). |
int |
hashCode() |
String |
id()
The per-bucket unique ID of the
Document. |
MutationToken |
mutationToken()
The optional, opaque mutation token set after a successful mutation and if enabled on the environment.
|
String |
toString() |
public String id()
DocumentThe per-bucket unique ID of the Document.
public long cas()
DocumentThe last-known CAS value for the Document (0 if not set).
public int expiry()
DocumentThe optional expiration time for the Document (0 if not set).
public MutationToken mutationToken()
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.
mutationToken in interface Document<T>public static <T> EntityDocument<T> create(T content)
public static <T> EntityDocument<T> create(String id, T content)
public static <T> EntityDocument<T> create(String id, int expiry, T content)
public static <T> EntityDocument<T> create(String id, T content, long cas)
public static <T> EntityDocument<T> create(String id, int expiry, T content, long cas)
public static <T> EntityDocument<T> create(String id, int expiry, T content, long cas, MutationToken mutationToken)
Copyright © 2015 Couchbase, Inc.