Class JsonArrayDocument
java.lang.Object
com.couchbase.client.java.document.AbstractDocument<JsonArray>
com.couchbase.client.java.document.JsonArrayDocument
- All Implemented Interfaces:
Document<JsonArray>
,Serializable
public class JsonArrayDocument extends AbstractDocument<JsonArray> implements Serializable
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.- Since:
- 2.0.0
- Author:
- Michael Nitschinger
- See Also:
- Serialized Form
-
Method Summary
Modifier and Type Method Description static JsonArrayDocument
create(String id)
Creates aJsonDocument
which the document id.static JsonArrayDocument
create(String id, int expiry, JsonArray content)
Creates aJsonDocument
which the document id, JSON content and the expiration time.static JsonArrayDocument
create(String id, int expiry, JsonArray content, long cas)
Creates aJsonDocument
which the document id, JSON content, CAS value, expiration time and status code.static JsonArrayDocument
create(String id, int expiry, JsonArray content, long cas, MutationToken mutationToken)
Creates aJsonDocument
which the document id, JSON content, CAS value, expiration time and status code.static JsonArrayDocument
create(String id, JsonArray content)
Creates aJsonDocument
which the document id and JSON content.static JsonArrayDocument
create(String id, JsonArray content, long cas)
Creates aJsonDocument
which the document id, JSON content and the CAS value.static JsonArrayDocument
from(JsonArrayDocument doc, long cas)
Creates a copy from a differentJsonDocument
, but changes the CAS value.static JsonArrayDocument
from(JsonArrayDocument doc, JsonArray content)
Creates a copy from a differentJsonDocument
, but changes the content.static JsonArrayDocument
from(JsonArrayDocument doc, String id)
Creates a copy from a differentJsonArrayDocument
, but changes the document ID.static JsonArrayDocument
from(JsonArrayDocument doc, String id, JsonArray content)
Creates a copy from a differentJsonDocument
, but changes the document ID and content.Methods inherited from class com.couchbase.client.java.document.AbstractDocument
cas, content, equals, expiry, hashCode, id, mutationToken, readFromSerializedStream, toString, writeToSerializedStream
-
Method Details
-
create
Creates aJsonDocument
which the document id.- Parameters:
id
- the per-bucket unique document id.- Returns:
- a
JsonDocument
.
-
create
Creates aJsonDocument
which the document id and JSON content.- Parameters:
id
- the per-bucket unique document id.content
- the content of the document.- Returns:
- a
JsonDocument
.
-
create
Creates aJsonDocument
which the document id, JSON content and the CAS value.- Parameters:
id
- the per-bucket unique document id.content
- the content of the document.cas
- the CAS (compare and swap) value for optimistic concurrency.- Returns:
- a
JsonDocument
.
-
create
Creates aJsonDocument
which the document id, JSON content and the expiration time.- Parameters:
id
- the per-bucket unique document id.content
- the content of the document.expiry
- the expiration time of the document.- Returns:
- a
JsonArrayDocument
.
-
create
Creates aJsonDocument
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.- Parameters:
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.- Returns:
- a
JsonArrayDocument
.
-
create
public static JsonArrayDocument create(String id, int expiry, JsonArray content, long cas, MutationToken mutationToken)Creates aJsonDocument
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.- Parameters:
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.mutationToken
- the optional mutation token.- Returns:
- a
JsonArrayDocument
.
-
from
Creates a copy from a differentJsonArrayDocument
, but changes the document ID.- Parameters:
doc
- the originalJsonArrayDocument
to copy.id
- the per-bucket unique document id.- Returns:
- a copied
JsonArrayDocument
with the changed properties.
-
from
Creates a copy from a differentJsonDocument
, but changes the content.- Parameters:
doc
- the originalJsonDocument
to copy.content
- the content of the document.- Returns:
- a copied
JsonDocument
with the changed properties.
-
from
Creates a copy from a differentJsonDocument
, but changes the document ID and content.- Parameters:
doc
- the originalJsonDocument
to copy.id
- the per-bucket unique document id.content
- the content of the document.- Returns:
- a copied
JsonDocument
with the changed properties.
-
from
Creates a copy from a differentJsonDocument
, but changes the CAS value.- Parameters:
doc
- the originalJsonDocument
to copy.cas
- the CAS (compare and swap) value for optimistic concurrency.- Returns:
- a copied
JsonDocument
with the changed properties.
-