public class SerializableTranscoder extends Object implements Transcoder
Serializable
interface.
Please note that this transcoder is NOT turning the value into a JSON representation, rather it is using the java object serialization which will look to the server like an opaque binary blob. It is useful though if you want to store and retrieve arbitrary java objects and use couchbase as a cache for them.
Transcoder.EncodedValue
Modifier and Type | Field and Description |
---|---|
static SerializableTranscoder |
INSTANCE |
Modifier and Type | Method and Description |
---|---|
<T> T |
decode(Class<T> target,
byte[] input,
int flags)
Decodes the wire representation into the entity based on the data format.
|
Transcoder.EncodedValue |
encode(Object input)
Encodes the given input into the wire representation based on the data format.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
decode
public static SerializableTranscoder INSTANCE
public Transcoder.EncodedValue encode(Object input)
Transcoder
encode
in interface Transcoder
input
- the input object to encode.public <T> T decode(Class<T> target, byte[] input, int flags)
Transcoder
decode
in interface Transcoder
target
- the target type to decode.input
- the wire representation to decode.flags
- the flags on the wireCopyright © 2021 Couchbase, Inc.. All rights reserved.