Package com.couchbase.client.java.codec
Interface Transcoder
-
- All Known Implementing Classes:
JsonTranscoder,LegacyTranscoder,RawBinaryTranscoder,RawJsonTranscoder,RawStringTranscoder,Sdk2CompatibleLegacyTranscoder,SerializableTranscoder
public interface TranscoderThe 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 classTranscoder.EncodedValueRepresents the tuple of encoded value and flags to be used on the wire.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <T> Tdecode(TypeRef<T> target, byte[] input, int flags)Decodes the wire representation into the entity based on the data format.<T> Tdecode(Class<T> target, byte[] input, int flags)Decodes the wire representation into the entity based on the data format.Transcoder.EncodedValueencode(Object input)Encodes the given input into the wire representation based on the data format.
-
-
-
Method Detail
-
encode
Transcoder.EncodedValue encode(Object input)
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
<T> T decode(Class<T> target, byte[] input, int flags)
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
default <T> T decode(TypeRef<T> target, byte[] input, int flags)
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.
-
-