Interface Serde<T>

Type Parameters:
T - Type to be serialized from and deserialized into. A class that implements this interface is expected to have a constructor with no parameter.
All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
Serdes.ByteArraySerde, Serdes.ByteBufferSerde, Serdes.BytesSerde, Serdes.DoubleSerde, Serdes.FloatSerde, Serdes.IntegerSerde, Serdes.ListSerde, Serdes.LongSerde, Serdes.ShortSerde, Serdes.StringSerde, Serdes.UUIDSerde, Serdes.VoidSerde, Serdes.WrapperSerde, WindowedSerdes.SessionWindowedSerde, WindowedSerdes.TimeWindowedSerde

public interface Serde<T>
extends Closeable
The interface for wrapping a serializer and deserializer for the given data type.
  • Method Summary

    Modifier and Type Method Description
    default void close()
    Close this serde class, which will close the underlying serializer and deserializer.
    default void configure​(Map<String,​?> configs, boolean isKey)
    Configure this class, which will configure the underlying serializer and deserializer.
    Deserializer<T> deserializer()  
    Serializer<T> serializer()  
  • Method Details

    • configure

      default void configure​(Map<String,​?> configs, boolean isKey)
      Configure this class, which will configure the underlying serializer and deserializer.
      Parameters:
      configs - configs in key/value pairs
      isKey - whether is for key or value
    • close

      default void close()
      Close this serde class, which will close the underlying serializer and deserializer.

      This method has to be idempotent because it might be called multiple times.

      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • serializer

      Serializer<T> serializer()
    • deserializer

      Deserializer<T> deserializer()