public class JsonArrayTranscoder extends AbstractTranscoder<JsonArrayDocument,JsonArray>
A transcoder to encode and decode JsonDocuments.
| Constructor and Description |
|---|
JsonArrayTranscoder() |
| Modifier and Type | Method and Description |
|---|---|
JsonArray |
byteBufToJsonArray(com.couchbase.client.deps.io.netty.buffer.ByteBuf input) |
Class<JsonArrayDocument> |
documentType() |
protected JsonArrayDocument |
doDecode(String id,
com.couchbase.client.deps.io.netty.buffer.ByteBuf content,
long cas,
int expiry,
int flags,
ResponseStatus status)
Perform the decoding of the received response.
|
protected Tuple2<com.couchbase.client.deps.io.netty.buffer.ByteBuf,Integer> |
doEncode(JsonArrayDocument document)
Perform the encoding of the request document.
|
com.couchbase.client.deps.io.netty.buffer.ByteBuf |
jsonArrayToByteBuf(JsonArray input) |
String |
jsonArrayToString(JsonArray input) |
JsonArrayDocument |
newDocument(String id,
int expiry,
JsonArray content,
long cas)
Creates a new Document with the passed in information.
|
JsonArrayDocument |
newDocument(String id,
int expiry,
JsonArray content,
long cas,
MutationToken mutationToken)
Default implementation for backwards compatibility.
|
JsonArray |
stringToJsonArray(String input) |
decode, encode, shouldAutoReleaseOnDecode, shouldAutoReleaseOnErrorpublic Class<JsonArrayDocument> documentType()
protected Tuple2<com.couchbase.client.deps.io.netty.buffer.ByteBuf,Integer> doEncode(JsonArrayDocument document) throws Exception
AbstractTranscoderPerform the encoding of the request document.
doEncode in class AbstractTranscoder<JsonArrayDocument,JsonArray>document - the document to encode.Exception - if something goes wrong during the encode process.protected JsonArrayDocument doDecode(String id, com.couchbase.client.deps.io.netty.buffer.ByteBuf content, long cas, int expiry, int flags, ResponseStatus status) throws Exception
AbstractTranscoderPerform the decoding of the received response.
doDecode in class AbstractTranscoder<JsonArrayDocument,JsonArray>id - the id of the document.content - the encoded content of the document.cas - the cas value of the document.expiry - the expiration time of the document.flags - the flags set on the document.status - the response status.Exception - if something goes wrong during the decode process.public JsonArrayDocument newDocument(String id, int expiry, JsonArray content, long cas)
TranscoderCreates a new Document with the passed in information.
Use the one with the mutation token instead (Transcoder.newDocument(String, int, Object, long, MutationToken)).
id - the id of the document.expiry - the document expiration.content - the document content.cas - the documents cas value.public JsonArrayDocument newDocument(String id, int expiry, JsonArray content, long cas, MutationToken mutationToken)
AbstractTranscoderDefault implementation for backwards compatibility.
newDocument in interface Transcoder<JsonArrayDocument,JsonArray>newDocument in class AbstractTranscoder<JsonArrayDocument,JsonArray>id - the id of the document.expiry - the document expiration.content - the document content.cas - the documents cas value.mutationToken - the documents mutation token.public String jsonArrayToString(JsonArray input) throws Exception
Exceptionpublic com.couchbase.client.deps.io.netty.buffer.ByteBuf jsonArrayToByteBuf(JsonArray input) throws Exception
Exceptionpublic JsonArray stringToJsonArray(String input) throws Exception
ExceptionCopyright © 2015 Couchbase, Inc.