Class JsonDoubleDocument
- java.lang.Object
-
- com.couchbase.client.java.document.AbstractDocument<Double>
-
- com.couchbase.client.java.document.JsonDoubleDocument
-
- All Implemented Interfaces:
Document<Double>,Serializable
public class JsonDoubleDocument extends AbstractDocument<Double> implements Serializable
Stores a properly encoded JSON scalar double or float as the toplevel type. This document works exactly likeJsonDocument, but it accepts a different toplevel type. This document is interoperable with other SDKs.- Since:
- 2.0
- Author:
- Michael Nitschinger
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static JsonDoubleDocumentcreate(String id)Creates aJsonDoubleDocumentwhich the document id.static JsonDoubleDocumentcreate(String id, int expiry, Double content)Creates aJsonDoubleDocumentwhich the document id, content and the expiration time.static JsonDoubleDocumentcreate(String id, int expiry, Double content, long cas)Creates aJsonDoubleDocumentwhich the document id, content, CAS value, expiration time and status code.static JsonDoubleDocumentcreate(String id, int expiry, Double content, long cas, MutationToken mutationToken)Creates aJsonDoubleDocumentwhich the document id, content, CAS value, expiration time and status code.static JsonDoubleDocumentcreate(String id, Double content)Creates aJsonDoubleDocumentwhich the document id and content.static JsonDoubleDocumentcreate(String id, Double content, long cas)Creates aJsonDoubleDocumentwhich the document id, content and the CAS value.static JsonDoubleDocumentfrom(JsonDoubleDocument doc, long cas)Creates a copy from a differentJsonDoubleDocument, but changes the CAS value.static JsonDoubleDocumentfrom(JsonDoubleDocument doc, Double content)Creates a copy from a differentJsonDoubleDocument, but changes the content.static JsonDoubleDocumentfrom(JsonDoubleDocument doc, String id)Creates a copy from a differentJsonDoubleDocument, but changes the document ID.static JsonDoubleDocumentfrom(JsonDoubleDocument doc, String id, Double content)Creates a copy from a differentJsonDoubleDocument, 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 Detail
-
create
public static JsonDoubleDocument create(String id)
Creates aJsonDoubleDocumentwhich the document id.- Parameters:
id- the per-bucket unique document id.- Returns:
- a
JsonDoubleDocument.
-
create
public static JsonDoubleDocument create(String id, Double content)
Creates aJsonDoubleDocumentwhich the document id and content.- Parameters:
id- the per-bucket unique document id.content- the content of the document.- Returns:
- a
JsonDoubleDocument.
-
create
public static JsonDoubleDocument create(String id, Double content, long cas)
Creates aJsonDoubleDocumentwhich the document id, 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
JsonDoubleDocument.
-
create
public static JsonDoubleDocument create(String id, int expiry, Double content)
Creates aJsonDoubleDocumentwhich the document id, 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
JsonDoubleDocument.
-
create
public static JsonDoubleDocument create(String id, int expiry, Double content, long cas)
Creates aJsonDoubleDocumentwhich 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.- 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
JsonDoubleDocument.
-
create
public static JsonDoubleDocument create(String id, int expiry, Double content, long cas, MutationToken mutationToken)
Creates aJsonDoubleDocumentwhich 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.- 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
JsonDoubleDocument.
-
from
public static JsonDoubleDocument from(JsonDoubleDocument doc, String id)
Creates a copy from a differentJsonDoubleDocument, but changes the document ID.- Parameters:
doc- the originalJsonDoubleDocumentto copy.id- the per-bucket unique document id.- Returns:
- a copied
JsonDoubleDocumentwith the changed properties.
-
from
public static JsonDoubleDocument from(JsonDoubleDocument doc, Double content)
Creates a copy from a differentJsonDoubleDocument, but changes the content.- Parameters:
doc- the originalJsonDoubleDocumentto copy.content- the content of the document.- Returns:
- a copied
JsonDoubleDocumentwith the changed properties.
-
from
public static JsonDoubleDocument from(JsonDoubleDocument doc, String id, Double content)
Creates a copy from a differentJsonDoubleDocument, but changes the document ID and content.- Parameters:
doc- the originalJsonDoubleDocumentto copy.id- the per-bucket unique document id.content- the content of the document.- Returns:
- a copied
JsonDoubleDocumentwith the changed properties.
-
from
public static JsonDoubleDocument from(JsonDoubleDocument doc, long cas)
Creates a copy from a differentJsonDoubleDocument, but changes the CAS value.- Parameters:
doc- the originalJsonDoubleDocumentto copy.cas- the CAS (compare and swap) value for optimistic concurrency.- Returns:
- a copied
JsonDoubleDocumentwith the changed properties.
-
-