public class JsonStringDocument extends AbstractDocument<java.lang.String>
Stores a properly encoded JSON scalar quoted string as the toplevel type.
This document works exactly like JsonDocument, but it accepts a different toplevel type. This document is interoperable with other SDKs.
| Modifier and Type | Method and Description |
|---|---|
static JsonStringDocument |
create(java.lang.String id)
Creates a
JsonStringDocument which the document id. |
static JsonStringDocument |
create(java.lang.String id,
int expiry,
java.lang.String content)
Creates a
JsonStringDocument which the document id, content and the expiration time. |
static JsonStringDocument |
create(java.lang.String id,
int expiry,
java.lang.String content,
long cas)
Creates a
JsonStringDocument which the document id, content, CAS value, expiration time and status code. |
static JsonStringDocument |
create(java.lang.String id,
java.lang.String content)
Creates a
JsonStringDocument which the document id and content. |
static JsonStringDocument |
create(java.lang.String id,
java.lang.String content,
long cas)
Creates a
JsonStringDocument which the document id, content and the CAS value. |
static JsonStringDocument |
empty()
Creates a empty
JsonStringDocument. |
static JsonStringDocument |
from(JsonStringDocument doc,
long cas)
Creates a copy from a different
JsonStringDocument, but changes the CAS value. |
static JsonStringDocument |
from(JsonStringDocument doc,
java.lang.String id,
java.lang.String content)
Creates a copy from a different
JsonStringDocument, but changes the document ID and content. |
public static JsonStringDocument empty()
Creates a empty JsonStringDocument.
JsonStringDocument.public static JsonStringDocument create(java.lang.String id)
Creates a JsonStringDocument which the document id.
id - the per-bucket unique document id.JsonStringDocument.public static JsonStringDocument create(java.lang.String id, java.lang.String content)
Creates a JsonStringDocument which the document id and content.
id - the per-bucket unique document id.content - the content of the document.JsonStringDocument.public static JsonStringDocument create(java.lang.String id, java.lang.String content, long cas)
Creates a JsonStringDocument which the document id, 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.JsonStringDocument.public static JsonStringDocument create(java.lang.String id, int expiry, java.lang.String content)
Creates a JsonStringDocument which the document id, 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.JsonStringDocument.public static JsonStringDocument create(java.lang.String id, int expiry, java.lang.String content, long cas)
Creates a JsonStringDocument which the document id, 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.JsonStringDocument.public static JsonStringDocument from(JsonStringDocument doc, java.lang.String id, java.lang.String content)
Creates a copy from a different JsonStringDocument, but changes the document ID and content.
doc - the original JsonStringDocument to copy.id - the per-bucket unique document id.content - the content of the document.JsonStringDocument with the changed properties.public static JsonStringDocument from(JsonStringDocument doc, long cas)
Creates a copy from a different JsonStringDocument, but changes the CAS value.
doc - the original JsonStringDocument to copy.cas - the CAS (compare and swap) value for optimistic concurrency.JsonStringDocument with the changed properties.