Class ListSerializer<Inner>
- java.lang.Object
-
- org.apache.kafka.common.serialization.ListSerializer<Inner>
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Serializer<List<Inner>>
public class ListSerializer<Inner> extends Object implements Serializer<List<Inner>>
-
-
Constructor Summary
Constructors Constructor Description ListSerializer()
ListSerializer(Serializer<Inner> inner)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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)
Convertdata
into a byte array.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.kafka.common.serialization.Serializer
serialize
-
-
-
-
Constructor Detail
-
ListSerializer
public ListSerializer()
-
ListSerializer
public ListSerializer(Serializer<Inner> inner)
-
-
Method Detail
-
getInnerSerializer
public Serializer<Inner> getInnerSerializer()
-
configure
public void configure(Map<String,?> configs, boolean isKey)
Description copied from interface:Serializer
Configure this class.- Specified by:
configure
in interfaceSerializer<Inner>
- Parameters:
configs
- configs in key/value pairsisKey
- whether is for key or value
-
serialize
public byte[] serialize(String topic, List<Inner> data)
Description copied from interface:Serializer
Convertdata
into a byte array.- Specified by:
serialize
in interfaceSerializer<Inner>
- Parameters:
topic
- topic associated with datadata
- typed data- Returns:
- serialized bytes
-
close
public void close()
Description copied from interface:Serializer
Close this serializer.This method must be idempotent as it may be called multiple times.
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceSerializer<Inner>
-
-