T - The class to be serializedpublic class ObjectSerializer<T> extends Object implements org.apache.kafka.common.serialization.Serializer<T>
| Constructor and Description |
|---|
ObjectSerializer() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
does nothing in this case
|
void |
configure(Map<String,?> map,
boolean b)
does nothing in this case
|
byte[] |
serialize(String topic,
T dataObject)
serializes the given dataObject to a JSON String
|
public void configure(Map<String,?> map, boolean b)
configure in interface org.apache.kafka.common.serialization.Serializer<T>map - map for configurationb - booleanpublic byte[] serialize(String topic, T dataObject)
serialize in interface org.apache.kafka.common.serialization.Serializer<T>topic - the topic, the object is sent to; not used heredataObject - the object which should be serializedpublic void close()
close in interface Closeableclose in interface AutoCloseableclose in interface org.apache.kafka.common.serialization.Serializer<T>Copyright © 2016. All rights reserved.