public class BinaryDocument extends AbstractDocument<com.couchbase.client.deps.io.netty.buffer.ByteBuf>
Represents raw ByteBuf
content in a document.
Modifier and Type | Method and Description |
---|---|
static BinaryDocument |
create(java.lang.String id)
Creates a
BinaryDocument which the document id. |
static BinaryDocument |
create(java.lang.String id,
com.couchbase.client.deps.io.netty.buffer.ByteBuf content)
Creates a
BinaryDocument which the document id and content. |
static BinaryDocument |
create(java.lang.String id,
com.couchbase.client.deps.io.netty.buffer.ByteBuf content,
long cas)
Creates a
BinaryDocument which the document id, content and the CAS value. |
static BinaryDocument |
create(java.lang.String id,
int expiry,
com.couchbase.client.deps.io.netty.buffer.ByteBuf content)
Creates a
BinaryDocument which the document id, content and the expiration time. |
static BinaryDocument |
create(java.lang.String id,
int expiry,
com.couchbase.client.deps.io.netty.buffer.ByteBuf content,
long cas)
Creates a
BinaryDocument which the document id, content, CAS value, expiration time and status code. |
static BinaryDocument |
empty()
Creates a empty
BinaryDocument . |
static BinaryDocument |
from(BinaryDocument doc,
long cas)
Creates a copy from a different
BinaryDocument , but changes the CAS value. |
static BinaryDocument |
from(BinaryDocument doc,
java.lang.String id,
com.couchbase.client.deps.io.netty.buffer.ByteBuf content)
Creates a copy from a different
BinaryDocument , but changes the document ID and content. |
public static BinaryDocument empty()
Creates a empty BinaryDocument
.
BinaryDocument
.public static BinaryDocument create(java.lang.String id)
Creates a BinaryDocument
which the document id.
id
- the per-bucket unique document id.BinaryDocument
.public static BinaryDocument create(java.lang.String id, com.couchbase.client.deps.io.netty.buffer.ByteBuf content)
Creates a BinaryDocument
which the document id and content.
id
- the per-bucket unique document id.content
- the content of the document.BinaryDocument
.public static BinaryDocument create(java.lang.String id, com.couchbase.client.deps.io.netty.buffer.ByteBuf content, long cas)
Creates a BinaryDocument
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.BinaryDocument
.public static BinaryDocument create(java.lang.String id, int expiry, com.couchbase.client.deps.io.netty.buffer.ByteBuf content)
Creates a BinaryDocument
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.BinaryDocument
.public static BinaryDocument create(java.lang.String id, int expiry, com.couchbase.client.deps.io.netty.buffer.ByteBuf content, long cas)
Creates a BinaryDocument
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.BinaryDocument
.public static BinaryDocument from(BinaryDocument doc, java.lang.String id, com.couchbase.client.deps.io.netty.buffer.ByteBuf content)
Creates a copy from a different BinaryDocument
, but changes the document ID and content.
doc
- the original BinaryDocument
to copy.id
- the per-bucket unique document id.content
- the content of the document.BinaryDocument
with the changed properties.public static BinaryDocument from(BinaryDocument doc, long cas)
Creates a copy from a different BinaryDocument
, but changes the CAS value.
doc
- the original BinaryDocument
to copy.cas
- the CAS (compare and swap) value for optimistic concurrency.BinaryDocument
with the changed properties.