Class CoreTransactionGetResult
java.lang.Object
com.couchbase.client.core.transaction.CoreTransactionGetResult
Represents a value fetched from Couchbase, along with additional transactional metadata.
-
Constructor Summary
ConstructorDescriptionCoreTransactionGetResult
(String id, byte[] content, int userFlags, long cas, CollectionIdentifier collection, TransactionLinks links, Optional<DocumentMetadata> documentMetadata, Optional<com.couchbase.client.core.deps.com.fasterxml.jackson.databind.JsonNode> txnMeta, Optional<String> crc32OfGet) Note that it's intentionally obfuscated here as to whether both content and userFlags come from the document's current body, or staged in the transactional metadata. -
Method Summary
Modifier and TypeMethodDescriptionlong
cas()
Returns the document's CAS (compare-and-swap) value, used for optimistic concurrency.byte[]
Returns the raw unconverted contents as a byte[].static CoreTransactionGetResult
createFrom
(CollectionIdentifier collection, String documentId, SubdocGetResponse doc) static CoreTransactionGetResult
createFrom
(CoreTransactionGetResult doc, byte[] content) id()
Returns the document's ID, which must be unique across the bucket.boolean
isBinary()
links()
toString()
int
-
Constructor Details
-
CoreTransactionGetResult
@Internal public CoreTransactionGetResult(String id, @Nullable byte[] content, int userFlags, long cas, CollectionIdentifier collection, @Nullable TransactionLinks links, Optional<DocumentMetadata> documentMetadata, Optional<com.couchbase.client.core.deps.com.fasterxml.jackson.databind.JsonNode> txnMeta, Optional<String> crc32OfGet) Note that it's intentionally obfuscated here as to whether both content and userFlags come from the document's current body, or staged in the transactional metadata. The MAV read resolution has been performed by this point.- Parameters:
content
- will be nullable for tombstones, and some niche cases like REMOVE to REPLACE on same doc
-
-
Method Details
-
toString
-
documentMetadata
-
links
-
id
Returns the document's ID, which must be unique across the bucket. -
cas
public long cas()Returns the document's CAS (compare-and-swap) value, used for optimistic concurrency. -
contentAsBytes
Returns the raw unconverted contents as a byte[]. -
crc32OfGet
-
isBinary
public boolean isBinary() -
createFrom
@Internal public static CoreTransactionGetResult createFrom(CoreTransactionGetResult doc, byte[] content) -
createFrom
@Internal public static CoreTransactionGetResult createFrom(CollectionIdentifier collection, String documentId, SubdocGetResponse doc) throws IOException - Throws:
IOException
-
collection
-
userFlags
public int userFlags()
-