Class Codecs.JsonCodec

java.lang.Object
io.quarkus.redis.datasource.codecs.Codecs.JsonCodec
All Implemented Interfaces:
Codec
Enclosing class:
Codecs

public static class Codecs.JsonCodec extends Object implements Codec
  • Constructor Details

    • JsonCodec

      public JsonCodec(Type clazz)
  • Method Details

    • canHandle

      public boolean canHandle(Type clazz)
      Description copied from interface: Codec
      Checks if the current codec can handle the serialization and deserialization of object from the given type.
      Specified by:
      canHandle in interface Codec
      Parameters:
      clazz - the type, cannot be null
      Returns:
      true if the codec can handle the type, false otherwise
    • encode

      public byte[] encode(Object item)
      Description copied from interface: Codec
      Encodes the given object. The type of the given object matches the type used to call the Codec.canHandle(Type) method.
      Specified by:
      encode in interface Codec
      Parameters:
      item - the item
      Returns:
      the encoded content
    • decode

      public Object decode(byte[] payload)
      Description copied from interface: Codec
      Decodes the given bytes to an object. The codec must return an instance of the type used to call the Codec.canHandle(Type) method.
      Specified by:
      decode in interface Codec
      Parameters:
      payload - the bytes
      Returns:
      the object