public class SerializableDocument extends AbstractDocument<Serializable> implements Serializable
Handles content which implements Serializable
.
This document is not interoperable with other SDKs, since java object serialization is not convertible into other programming languages. It is compatible with the legacy object serialization from the 1.* SDK series.
Modifier and Type | Method and Description |
---|---|
static SerializableDocument |
create(String id)
Creates a
SerializableDocument which the document id. |
static SerializableDocument |
create(String id,
int expiry,
Serializable content)
Creates a
SerializableDocument which the document id, content and the expiration time. |
static SerializableDocument |
create(String id,
int expiry,
Serializable content,
long cas)
Creates a
SerializableDocument which the document id, content, CAS value, expiration time and status code. |
static SerializableDocument |
create(String id,
int expiry,
Serializable content,
long cas,
com.couchbase.client.core.message.kv.MutationToken mutationToken)
Creates a
SerializableDocument which the document id, content, CAS value, expiration time and status code. |
static SerializableDocument |
create(String id,
Serializable content)
Creates a
SerializableDocument which the document id and content. |
static SerializableDocument |
create(String id,
Serializable content,
long cas)
Creates a
SerializableDocument which the document id, content and the CAS value. |
static SerializableDocument |
from(SerializableDocument doc,
long cas)
Creates a copy from a different
SerializableDocument , but changes the CAS value. |
static SerializableDocument |
from(SerializableDocument doc,
Long content)
Creates a copy from a different
SerializableDocument , but changes the content. |
static SerializableDocument |
from(SerializableDocument doc,
String id)
Creates a copy from a different
SerializableDocument , but changes the document ID. |
static SerializableDocument |
from(SerializableDocument doc,
String id,
Long content)
Creates a copy from a different
SerializableDocument , but changes the document ID and content. |
cas, content, equals, expiry, hashCode, id, mutationToken, readFromSerializedStream, toString, writeToSerializedStream
public static SerializableDocument create(String id)
Creates a SerializableDocument
which the document id.
id
- the per-bucket unique document id.SerializableDocument
.public static SerializableDocument create(String id, Serializable content)
Creates a SerializableDocument
which the document id and content.
id
- the per-bucket unique document id.content
- the content of the document.SerializableDocument
.public static SerializableDocument create(String id, Serializable content, long cas)
Creates a SerializableDocument
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.SerializableDocument
.public static SerializableDocument create(String id, int expiry, Serializable content)
Creates a SerializableDocument
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.SerializableDocument
.public static SerializableDocument create(String id, int expiry, Serializable content, long cas)
Creates a SerializableDocument
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.SerializableDocument
.public static SerializableDocument create(String id, int expiry, Serializable content, long cas, com.couchbase.client.core.message.kv.MutationToken mutationToken)
Creates a SerializableDocument
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.SerializableDocument
.public static SerializableDocument from(SerializableDocument doc, String id)
Creates a copy from a different SerializableDocument
, but changes the document ID.
doc
- the original SerializableDocument
to copy.id
- the per-bucket unique document id.SerializableDocument
with the changed properties.public static SerializableDocument from(SerializableDocument doc, Long content)
Creates a copy from a different SerializableDocument
, but changes the content.
doc
- the original SerializableDocument
to copy.content
- the content of the document.SerializableDocument
with the changed properties.public static SerializableDocument from(SerializableDocument doc, String id, Long content)
Creates a copy from a different SerializableDocument
, but changes the document ID and content.
doc
- the original SerializableDocument
to copy.id
- the per-bucket unique document id.content
- the content of the document.SerializableDocument
with the changed properties.public static SerializableDocument from(SerializableDocument doc, long cas)
Creates a copy from a different SerializableDocument
, but changes the CAS value.
doc
- the original SerializableDocument
to copy.cas
- the CAS (compare and swap) value for optimistic concurrency.SerializableDocument
with the changed properties.Copyright © 2014 Couchbase, Inc.