public abstract class AbstractTranscoder<D extends Document<T>,T> extends java.lang.Object implements Transcoder<D,T>
Base Transcoder
which should be extended for compatibility.
Constructor and Description |
---|
AbstractTranscoder() |
Modifier and Type | Method and Description |
---|---|
D |
decode(java.lang.String id,
com.couchbase.client.deps.io.netty.buffer.ByteBuf content,
long cas,
int expiry,
int flags,
com.couchbase.client.core.message.ResponseStatus status) |
protected abstract D |
doDecode(java.lang.String id,
com.couchbase.client.deps.io.netty.buffer.ByteBuf content,
long cas,
int expiry,
int flags,
com.couchbase.client.core.message.ResponseStatus status)
Perform the decoding of the received response.
|
protected abstract com.couchbase.client.core.lang.Tuple2<com.couchbase.client.deps.io.netty.buffer.ByteBuf,java.lang.Integer> |
doEncode(D document)
Perform the encoding of the request document.
|
com.couchbase.client.core.lang.Tuple2<com.couchbase.client.deps.io.netty.buffer.ByteBuf,java.lang.Integer> |
encode(D document) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
documentType, newDocument
public D decode(java.lang.String id, com.couchbase.client.deps.io.netty.buffer.ByteBuf content, long cas, int expiry, int flags, com.couchbase.client.core.message.ResponseStatus status)
public com.couchbase.client.core.lang.Tuple2<com.couchbase.client.deps.io.netty.buffer.ByteBuf,java.lang.Integer> encode(D document)
protected abstract D doDecode(java.lang.String id, com.couchbase.client.deps.io.netty.buffer.ByteBuf content, long cas, int expiry, int flags, com.couchbase.client.core.message.ResponseStatus status) throws java.lang.Exception
Perform the decoding of the received response.
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.java.lang.Exception
- if something goes wrong during the decode process.protected abstract com.couchbase.client.core.lang.Tuple2<com.couchbase.client.deps.io.netty.buffer.ByteBuf,java.lang.Integer> doEncode(D document) throws java.lang.Exception
Perform the encoding of the request document.
document
- the document to encode.java.lang.Exception
- if something goes wrong during the encode process.