T
- Type to be serialized from.java.lang.AutoCloseable
, java.io.Closeable
ExtendedSerializer<T>
ByteArraySerializer
, ByteBufferSerializer
, BytesSerializer
, DoubleSerializer
, ExtendedSerializer.Wrapper
, FloatSerializer
, IntegerSerializer
, LongSerializer
, SessionWindowedSerializer
, ShortSerializer
, StringSerializer
, TimeWindowedSerializer
public interface Serializer<T>
extends java.io.Closeable
Implement ClusterResourceListener
to receive cluster metadata once it's available. Please see the class documentation for ClusterResourceListener for more information.
Modifier and Type | Method | Description |
---|---|---|
void |
close() |
Close this serializer.
|
void |
configure(java.util.Map<java.lang.String,?> configs,
boolean isKey) |
Configure this class.
|
byte[] |
serialize(java.lang.String topic,
T data) |
Convert
data into a byte array. |
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)
data
into a byte array.topic
- topic associated with datadata
- typed datavoid close()
close
in interface java.lang.AutoCloseable
close
in interface java.io.Closeable