Package com.couchbase.client.java.codec
Class SerializableTranscoder
java.lang.Object
com.couchbase.client.java.codec.SerializableTranscoder
- All Implemented Interfaces:
Transcoder
This transcoder allows to serialize and deserialize objects if they implement the
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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.couchbase.client.java.codec.Transcoder
Transcoder.EncodedValue
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescription<T> T
Decodes the wire representation into the entity based on the data format.Encodes the given input into the wire representation based on the data format.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.couchbase.client.java.codec.Transcoder
decode
-
Field Details
-
INSTANCE
-
-
Method Details
-
encode
Description copied from interface:Transcoder
Encodes the given input into the wire representation based on the data format.- Specified by:
encode
in interfaceTranscoder
- Parameters:
input
- the input object to encode.- Returns:
- the encoded wire representation of the payload.
-
decode
Description copied from interface:Transcoder
Decodes the wire representation into the entity based on the data format.- Specified by:
decode
in interfaceTranscoder
- Type Parameters:
T
- the generic type used for the decoding target.- Parameters:
target
- the target type to decode.input
- the wire representation to decode.flags
- the flags on the wire- Returns:
- the decoded entity.
-