public class JsonArrayDocument extends AbstractDocument<JsonArray>
Stores a properly encoded JSON array 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 JsonArrayDocument |
create(java.lang.String id)
Creates a
JsonDocument which the document id. |
static JsonArrayDocument |
create(java.lang.String id,
int expiry,
JsonArray content)
Creates a
JsonDocument which the document id, JSON content and the expiration time. |
static JsonArrayDocument |
create(java.lang.String id,
int expiry,
JsonArray content,
long cas)
Creates a
JsonDocument which the document id, JSON content, CAS value, expiration time and status code. |
static JsonArrayDocument |
create(java.lang.String id,
JsonArray content)
Creates a
JsonDocument which the document id and JSON content. |
static JsonArrayDocument |
create(java.lang.String id,
JsonArray content,
long cas)
Creates a
JsonDocument which the document id, JSON content and the CAS value. |
static JsonArrayDocument |
empty()
Creates a empty
JsonDocument . |
static JsonArrayDocument |
from(JsonArrayDocument doc,
JsonArray content)
Creates a copy from a different
JsonDocument , but changes the content. |
static JsonArrayDocument |
from(JsonArrayDocument doc,
long cas)
Creates a copy from a different
JsonDocument , but changes the CAS value. |
static JsonArrayDocument |
from(JsonArrayDocument doc,
java.lang.String id)
Creates a copy from a different
JsonArrayDocument , but changes the document ID. |
static JsonArrayDocument |
from(JsonArrayDocument doc,
java.lang.String id,
JsonArray content)
Creates a copy from a different
JsonDocument , but changes the document ID and content. |
public static JsonArrayDocument empty()
Creates a empty JsonDocument
.
JsonDocument
.public static JsonArrayDocument create(java.lang.String id)
Creates a JsonDocument
which the document id.
id
- the per-bucket unique document id.JsonDocument
.public static JsonArrayDocument create(java.lang.String id, JsonArray content)
Creates a JsonDocument
which the document id and JSON content.
id
- the per-bucket unique document id.content
- the content of the document.JsonDocument
.public static JsonArrayDocument create(java.lang.String id, JsonArray content, long cas)
Creates a JsonDocument
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.JsonDocument
.public static JsonArrayDocument create(java.lang.String id, int expiry, JsonArray content)
Creates a JsonDocument
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.JsonArrayDocument
.public static JsonArrayDocument create(java.lang.String id, int expiry, JsonArray content, long cas)
Creates a JsonDocument
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.JsonArrayDocument
.public static JsonArrayDocument from(JsonArrayDocument doc, java.lang.String id)
Creates a copy from a different JsonArrayDocument
, but changes the document ID.
doc
- the original JsonArrayDocument
to copy.id
- the per-bucket unique document id.JsonArrayDocument
with the changed properties.public static JsonArrayDocument from(JsonArrayDocument doc, JsonArray content)
Creates a copy from a different JsonDocument
, but changes the content.
doc
- the original JsonDocument
to copy.content
- the content of the document.JsonDocument
with the changed properties.public static JsonArrayDocument from(JsonArrayDocument doc, java.lang.String id, JsonArray content)
Creates a copy from a different JsonDocument
, but changes the document ID and content.
doc
- the original JsonDocument
to copy.id
- the per-bucket unique document id.content
- the content of the document.JsonDocument
with the changed properties.public static JsonArrayDocument from(JsonArrayDocument doc, long cas)
Creates a copy from a different JsonDocument
, but changes the CAS value.
doc
- the original JsonDocument
to copy.cas
- the CAS (compare and swap) value for optimistic concurrency.JsonDocument
with the changed properties.