public class JsonLongDocument extends AbstractDocument<java.lang.Long>
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(java.lang.String id)
Creates a
JsonLongDocument which the document id. |
static JsonLongDocument |
create(java.lang.String id,
int expiry,
java.lang.Long content)
Creates a
JsonLongDocument which the document id, content and the expiration time. |
static JsonLongDocument |
create(java.lang.String id,
int expiry,
java.lang.Long content,
long cas)
Creates a
JsonLongDocument which the document id, content, CAS value, expiration time and status code. |
static JsonLongDocument |
create(java.lang.String id,
java.lang.Long content)
Creates a
JsonLongDocument which the document id and content. |
static JsonLongDocument |
create(java.lang.String id,
java.lang.Long content,
long cas)
Creates a
JsonLongDocument which the document id, content and the CAS value. |
static JsonLongDocument |
empty()
Creates a empty
JsonLongDocument . |
static JsonLongDocument |
from(JsonLongDocument doc,
long cas)
Creates a copy from a different
JsonLongDocument , but changes the CAS value. |
static JsonLongDocument |
from(JsonLongDocument doc,
java.lang.Long content)
Creates a copy from a different
JsonLongDocument , but changes the content. |
static JsonLongDocument |
from(JsonLongDocument doc,
java.lang.String id)
Creates a copy from a different
JsonLongDocument , but changes the document ID. |
static JsonLongDocument |
from(JsonLongDocument doc,
java.lang.String id,
java.lang.Long content)
Creates a copy from a different
JsonLongDocument , but changes the document ID and content. |
public static JsonLongDocument empty()
Creates a empty JsonLongDocument
.
JsonLongDocument
.public static JsonLongDocument create(java.lang.String id)
Creates a JsonLongDocument
which the document id.
id
- the per-bucket unique document id.JsonLongDocument
.public static JsonLongDocument create(java.lang.String id, java.lang.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(java.lang.String id, java.lang.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(java.lang.String id, int expiry, java.lang.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(java.lang.String id, int expiry, java.lang.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 from(JsonLongDocument doc, java.lang.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, java.lang.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, java.lang.String id, java.lang.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.