public class StringDocument extends AbstractDocument<String> implements Serializable
JsonStringDocument
in that it is not automatically quoted and stored as-is on
the server side. The server will potentially not identify it is as a string if manual quotes are not added by the
application itself. It is compatible with legacy strings stored.Modifier and Type | Method and Description |
---|---|
static StringDocument |
create(String id)
Creates a
StringDocument which the document id. |
static StringDocument |
create(String id,
int expiry,
String content)
Creates a
StringDocument which the document id, content and the expiration time. |
static StringDocument |
create(String id,
int expiry,
String content,
long cas)
Creates a
StringDocument which the document id, content, CAS value, expiration time and status code. |
static StringDocument |
create(String id,
int expiry,
String content,
long cas,
MutationToken mutationToken)
Creates a
StringDocument which the document id, content, CAS value, expiration time and status code. |
static StringDocument |
create(String id,
String content)
Creates a
StringDocument which the document id and content. |
static StringDocument |
create(String id,
String content,
long cas)
Creates a
StringDocument which the document id, content and the CAS value. |
static StringDocument |
from(StringDocument doc,
long cas)
Creates a copy from a different
StringDocument , but changes the CAS value. |
static StringDocument |
from(StringDocument doc,
String id,
String content)
Creates a copy from a different
StringDocument , but changes the document ID and content. |
cas, content, equals, expiry, hashCode, id, mutationToken, readFromSerializedStream, toString, writeToSerializedStream
public static StringDocument create(String id)
StringDocument
which the document id.id
- the per-bucket unique document id.StringDocument
.public static StringDocument create(String id, String content)
StringDocument
which the document id and content.id
- the per-bucket unique document id.content
- the content of the document.StringDocument
.public static StringDocument create(String id, String content, long cas)
StringDocument
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.StringDocument
.public static StringDocument create(String id, int expiry, String content)
StringDocument
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.StringDocument
.public static StringDocument create(String id, int expiry, String content, long cas)
StringDocument
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.StringDocument
.public static StringDocument create(String id, int expiry, String content, long cas, MutationToken mutationToken)
StringDocument
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.StringDocument
.public static StringDocument from(StringDocument doc, String id, String content)
StringDocument
, but changes the document ID and content.doc
- the original StringDocument
to copy.id
- the per-bucket unique document id.content
- the content of the document.StringDocument
with the changed properties.public static StringDocument from(StringDocument doc, long cas)
StringDocument
, but changes the CAS value.doc
- the original StringDocument
to copy.cas
- the CAS (compare and swap) value for optimistic concurrency.StringDocument
with the changed properties.Copyright © 2015 Couchbase, Inc.