public class ListSerializer<Inner> extends Object implements Serializer<List<Inner>>
Constructor and Description |
---|
ListSerializer() |
ListSerializer(Serializer<Inner> inner) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close this serializer.
|
void |
configure(Map<String,?> configs,
boolean isKey)
Configure this class.
|
Serializer<Inner> |
getInnerSerializer() |
byte[] |
serialize(String topic,
List<Inner> data)
Convert
data into a byte array. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
serialize
public ListSerializer()
public ListSerializer(Serializer<Inner> inner)
public Serializer<Inner> getInnerSerializer()
public void configure(Map<String,?> configs, boolean isKey)
Serializer
configure
in interface Serializer<List<Inner>>
configs
- configs in key/value pairsisKey
- whether is for key or valuepublic byte[] serialize(String topic, List<Inner> data)
Serializer
data
into a byte array.serialize
in interface Serializer<List<Inner>>
topic
- topic associated with datadata
- typed datapublic void close()
Serializer
This method must be idempotent as it may be called multiple times.
close
in interface Closeable
close
in interface AutoCloseable
close
in interface Serializer<List<Inner>>