public class JsonLongDocument extends AbstractDocument<Long> implements Serializable
Stores a properly encoded JSON scalar long or int 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 JsonLongDocument |
create(String id)
Creates a
JsonLongDocument which the document id. |
static JsonLongDocument |
create(String id,
int expiry,
Long content)
Creates a
JsonLongDocument which the document id, content and the expiration time. |
static JsonLongDocument |
create(String id,
int expiry,
Long content,
long cas)
Creates a
JsonLongDocument which the document id, content, CAS value, expiration time and status code. |
static JsonLongDocument |
create(String id,
int expiry,
Long content,
long cas,
com.couchbase.client.core.message.kv.MutationToken mutationToken)
Creates a
JsonLongDocument which the document id, content, CAS value, expiration time and status code. |
static JsonLongDocument |
create(String id,
Long content)
Creates a
JsonLongDocument which the document id and content. |
static JsonLongDocument |
create(String id,
Long content,
long cas)
Creates a
JsonLongDocument which the document id, content and the CAS value. |
static JsonLongDocument |
from(JsonLongDocument doc,
long cas)
Creates a copy from a different
JsonLongDocument, but changes the CAS value. |
static JsonLongDocument |
from(JsonLongDocument doc,
Long content)
Creates a copy from a different
JsonLongDocument, but changes the content. |
static JsonLongDocument |
from(JsonLongDocument doc,
String id)
Creates a copy from a different
JsonLongDocument, but changes the document ID. |
static JsonLongDocument |
from(JsonLongDocument doc,
String id,
Long content)
Creates a copy from a different
JsonLongDocument, but changes the document ID and content. |
cas, content, equals, expiry, hashCode, id, mutationToken, readFromSerializedStream, toString, writeToSerializedStreampublic static JsonLongDocument create(String id)
Creates a JsonLongDocument which the document id.
id - the per-bucket unique document id.JsonLongDocument.public static JsonLongDocument create(String id, Long content)
Creates a JsonLongDocument which the document id and content.
id - the per-bucket unique document id.content - the content of the document.JsonLongDocument.public static JsonLongDocument create(String id, Long content, long cas)
Creates a JsonLongDocument 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.JsonLongDocument.public static JsonLongDocument create(String id, int expiry, Long content)
Creates a JsonLongDocument 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.JsonLongDocument.public static JsonLongDocument create(String id, int expiry, Long content, long cas)
Creates a JsonLongDocument 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.JsonLongDocument.public static JsonLongDocument create(String id, int expiry, Long content, long cas, com.couchbase.client.core.message.kv.MutationToken mutationToken)
Creates a JsonLongDocument 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.JsonLongDocument.public static JsonLongDocument from(JsonLongDocument doc, String id)
Creates a copy from a different JsonLongDocument, but changes the document ID.
doc - the original JsonLongDocument to copy.id - the per-bucket unique document id.JsonLongDocument with the changed properties.public static JsonLongDocument from(JsonLongDocument doc, Long content)
Creates a copy from a different JsonLongDocument, but changes the content.
doc - the original JsonLongDocument to copy.content - the content of the document.JsonLongDocument with the changed properties.public static JsonLongDocument from(JsonLongDocument doc, String id, Long content)
Creates a copy from a different JsonLongDocument, but changes the document ID and content.
doc - the original JsonLongDocument to copy.id - the per-bucket unique document id.content - the content of the document.JsonLongDocument with the changed properties.public static JsonLongDocument from(JsonLongDocument doc, long cas)
Creates a copy from a different JsonLongDocument, but changes the CAS value.
doc - the original JsonLongDocument to copy.cas - the CAS (compare and swap) value for optimistic concurrency.JsonLongDocument with the changed properties.Copyright © 2014 Couchbase, Inc.