Class JsonTranscoder

java.lang.Object
com.couchbase.client.java.codec.JsonTranscoder
All Implemented Interfaces:
Transcoder

public class JsonTranscoder extends Object implements Transcoder
  • Method Details

    • create

      public static JsonTranscoder create(JsonSerializer serializer)
    • encode

      public Transcoder.EncodedValue encode(Object input)
      Description copied from interface: Transcoder
      Encodes the given input into the wire representation based on the data format.
      Specified by:
      encode in interface Transcoder
      Parameters:
      input - the input object to encode.
      Returns:
      the encoded wire representation of the payload.
    • decode

      public <T> T decode(Class<T> target, byte[] input, int flags)
      Description copied from interface: Transcoder
      Decodes the wire representation into the entity based on the data format.
      Specified by:
      decode in interface Transcoder
      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.
    • decode

      public <T> T decode(TypeRef<T> target, byte[] input, int flags)
      Description copied from interface: Transcoder
      Decodes the wire representation into the entity based on the data format.
      Specified by:
      decode in interface Transcoder
      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.