Interface Serializer<T>

    • Method Detail

      • configure

        default void configure​(Map<String,​?> configs,
                               boolean isKey)
        Configure this class.
        Parameters:
        configs - configs in key/value pairs
        isKey - whether is for key or value
      • serialize

        byte[] serialize​(String topic,
                         T data)
        Convert data into a byte array.
        Parameters:
        topic - topic associated with data
        data - typed data
        Returns:
        serialized bytes
      • serialize

        default byte[] serialize​(String topic,
                                 Headers headers,
                                 T data)
        Convert data into a byte array.
        Parameters:
        topic - topic associated with data
        headers - headers associated with the record
        data - typed data
        Returns:
        serialized bytes
      • close

        default void close()
        Close this serializer.

        This method must be idempotent as it may be called multiple times.

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