public class RawJsonDocument extends AbstractDocument<String> implements Serializable
Represents a Document
that contains a already encoded JSON document.
The RawJsonDocument
can be used if a custom JSON library is already in place and the content should just be passed through and properly flagged as JSON on the server side. The only transcoding that is happening internally is the conversion into bytes from the provided JSON string.
Modifier and Type | Method and Description |
---|---|
static RawJsonDocument |
create(String id)
Creates a
RawJsonDocument which the document id. |
static RawJsonDocument |
create(String id,
int expiry,
String content)
Creates a
RawJsonDocument which the document id, JSON content and the expiration time. |
static RawJsonDocument |
create(String id,
int expiry,
String content,
long cas)
Creates a
RawJsonDocument which the document id, JSON content, CAS value, expiration time and status code. |
static RawJsonDocument |
create(String id,
int expiry,
String content,
long cas,
com.couchbase.client.core.message.kv.MutationToken mutationToken)
Creates a
RawJsonDocument which the document id, JSON content, CAS value, expiration time and status code. |
static RawJsonDocument |
create(String id,
String content)
Creates a
RawJsonDocument which the document id and JSON content. |
static RawJsonDocument |
create(String id,
String content,
long cas)
Creates a
RawJsonDocument which the document id, JSON content and the CAS value. |
static RawJsonDocument |
from(RawJsonDocument doc,
long cas)
Creates a copy from a different
RawJsonDocument , but changes the CAS value. |
static RawJsonDocument |
from(RawJsonDocument doc,
String id,
String content)
Creates a copy from a different
RawJsonDocument , but changes the document ID and content. |
cas, content, equals, expiry, hashCode, id, mutationToken, readFromSerializedStream, toString, writeToSerializedStream
public static RawJsonDocument create(String id)
Creates a RawJsonDocument
which the document id.
id
- the per-bucket unique document id.RawJsonDocument
.public static RawJsonDocument create(String id, String content)
Creates a RawJsonDocument
which the document id and JSON content.
id
- the per-bucket unique document id.content
- the content of the document.RawJsonDocument
.public static RawJsonDocument create(String id, String content, long cas)
Creates a RawJsonDocument
which the document id, JSON content and the CAS value.
id
- the per-bucket unique document id.content
- the content of the document.cas
- the CAS (compare and swap) value for optimistic concurrency.RawJsonDocument
.public static RawJsonDocument create(String id, int expiry, String content)
Creates a RawJsonDocument
which the document id, JSON content and the expiration time.
id
- the per-bucket unique document id.content
- the content of the document.expiry
- the expiration time of the document.RawJsonDocument
.public static RawJsonDocument create(String id, int expiry, String content, long cas)
Creates a RawJsonDocument
which the document id, JSON content, CAS value, expiration time and status code.
This factory method is normally only called within the client library when a response is analyzed and a document is returned which is enriched with the status code. It does not make sense to pre populate the status field from the user level code.
id
- the per-bucket unique document id.content
- the content of the document.cas
- the CAS (compare and swap) value for optimistic concurrency.expiry
- the expiration time of the document.RawJsonDocument
.public static RawJsonDocument create(String id, int expiry, String content, long cas, com.couchbase.client.core.message.kv.MutationToken mutationToken)
Creates a RawJsonDocument
which the document id, JSON content, CAS value, expiration time and status code.
This factory method is normally only called within the client library when a response is analyzed and a document is returned which is enriched with the status code. It does not make sense to pre populate the status field from the user level code.
id
- the per-bucket unique document id.content
- the content of the document.cas
- the CAS (compare and swap) value for optimistic concurrency.expiry
- the expiration time of the document.RawJsonDocument
.public static RawJsonDocument from(RawJsonDocument doc, String id, String content)
Creates a copy from a different RawJsonDocument
, but changes the document ID and content.
doc
- the original RawJsonDocument
to copy.id
- the per-bucket unique document id.content
- the content of the document.RawJsonDocument
with the changed properties.public static RawJsonDocument from(RawJsonDocument doc, long cas)
Creates a copy from a different RawJsonDocument
, but changes the CAS value.
doc
- the original RawJsonDocument
to copy.cas
- the CAS (compare and swap) value for optimistic concurrency.RawJsonDocument
with the changed properties.Copyright © 2014 Couchbase, Inc.