T
- Type to be serialized from.
A class that implements this interface is expected to have a constructor with no parameter.public interface Serializer<T>
extends java.io.Closeable
void configure(java.util.Map<java.lang.String,?> configs, boolean isKey)
configs
- configs in key/value pairsisKey
- whether is for key or valuebyte[] serialize(java.lang.String topic, T data)
topic
- topic associated with datadata
- typed datavoid close()
close
in interface java.lang.AutoCloseable
close
in interface java.io.Closeable