Interface Document<T>
- All Known Implementing Classes:
AbstractDocument
,BinaryDocument
,ByteArrayDocument
,EntityDocument
,JsonArrayDocument
,JsonBooleanDocument
,JsonDocument
,JsonDoubleDocument
,JsonLongDocument
,JsonStringDocument
,LegacyDocument
,RawJsonDocument
,SerializableDocument
,StringDocument
@Committed @Public public interface Document<T>
Represents a Couchbase Server
Document
which is stored in and retrieved from a AsyncBucket
.- Since:
- 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
.int
expiry()
The optional expiration time for theDocument
(0 if not set).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.
-
Method Details
-
id
String id()The per-bucket unique ID of theDocument
.- Returns:
- the document id.
-
content
T content()The content of theDocument
.- Returns:
- the content.
-
cas
long cas()The last-known CAS value for theDocument
(0 if not set).- Returns:
- the CAS value if set.
-
expiry
int expiry()The optional expiration time for theDocument
(0 if not set).- Returns:
- the expiration time.
-
mutationToken
MutationToken mutationToken()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.- Returns:
- the mutation token if set, otherwise null.
-