org.apache.kafka.common.serialization
Interface Serializer<T>
- Type Parameters:
T
- Type to be serialized from.
A class that implements this interface is expected to have a constructor with no parameter.
- All Known Implementing Classes:
- ByteArraySerializer, StringSerializer
public interface Serializer<T>
Method Summary |
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)
|
configure
void configure(java.util.Map<java.lang.String,?> configs,
boolean isKey)
- Configure this class.
- Parameters:
configs
- configs in key/value pairsisKey
- whether is for key or value
serialize
byte[] serialize(java.lang.String topic,
T data)
- Parameters:
topic
- topic associated with datadata
- typed data
- Returns:
- serialized bytes
close
void close()
- Close this serializer