Package com.couchbase.client.java.codec
Interface Transcoder
- All Known Implementing Classes:
JsonTranscoder
,LegacyTranscoder
,RawBinaryTranscoder
,RawJsonTranscoder
,RawStringTranscoder
,SerializableTranscoder
public interface Transcoder
The transcoder is responsible for transcoding KV binary packages between their binary and their java object
representation.
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Transcoder.EncodedValue
Represents the tuple of encoded value and flags to be used on the wire. -
Method Summary
Modifier and Type Method Description default <T> T
decode(TypeRef<T> target, byte[] input, int flags)
Decodes the wire representation into the entity based on the data format.<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.
-
Method Details
-
encode
Encodes the given input into the wire representation based on the data format.- Parameters:
input
- the input object to encode.- Returns:
- the encoded wire representation of the payload.
-
decode
Decodes the wire representation into the entity based on the data format.- Parameters:
target
- the target type to decode.input
- the wire representation to decode.flags
- the flags on the wire- Returns:
- the decoded entity.
-
decode
Decodes the wire representation into the entity based on the data format.- Parameters:
target
- the target type to decode.input
- the wire representation to decode.flags
- the flags on the wire- Returns:
- the decoded entity.
-