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 long
cas()
The last-known CAS value for theDocument
(0 if not set).T
content()
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)
boolean
equals(Object o)
int
expiry()
The optional expiration time for theDocument
(0 if not set).int
hashCode()
String
id()
The per-bucket unique ID of theDocument
.MutationToken
mutationToken()
The optional, opaque mutation token set after a successful mutation and if enabled on the environment.String
toString()
-
Method Details
-
id
Description copied from interface:Document
The per-bucket unique ID of theDocument
. -
content
Description copied from interface:Document
The content of theDocument
. -
cas
public long cas()Description copied from interface:Document
The last-known CAS value for theDocument
(0 if not set). -
expiry
public int expiry()Description copied from interface:Document
The optional expiration time for theDocument
(0 if not set). -
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 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)
-