Package io.confluent.kafka.serializers
Class KafkaJsonDecoder<T>
java.lang.Object
io.confluent.kafka.serializers.KafkaJsonDeserializer<T>
io.confluent.kafka.serializers.KafkaJsonDecoder<T>
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.kafka.common.serialization.Deserializer<T>,org.apache.kafka.tools.api.Decoder<T>
public class KafkaJsonDecoder<T>
extends KafkaJsonDeserializer<T>
implements org.apache.kafka.tools.api.Decoder<T>
Decode JSON data to an Object.
-
Constructor Summary
ConstructorsConstructorDescriptionKafkaJsonDecoder(kafka.utils.VerifiableProperties props) This constructor is needed by Kafka.KafkaJsonDecoder(kafka.utils.VerifiableProperties props, Class<T> type) Create a new decoder using the expected type to decode to -
Method Summary
Methods inherited from class io.confluent.kafka.serializers.KafkaJsonDeserializer
close, configure, configure, deserialize, getType, objectMapperMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.kafka.common.serialization.Deserializer
deserialize, deserialize
-
Constructor Details
-
KafkaJsonDecoder
public KafkaJsonDecoder(kafka.utils.VerifiableProperties props) This constructor is needed by Kafka. When used directly or through reflection, the type will default toObjectsince there is no way to infer a generic type. In particular, it is an error to do the following:// WARNING: DON'T DO THIS KafkaJsonDecoder<String> decoder = new KafkaJsonDecoder<String>(props);Instead you must use
KafkaJsonDecoder(VerifiableProperties, Class)with the expected type.- Parameters:
props- The decoder configuration
-
KafkaJsonDecoder
Create a new decoder using the expected type to decode to- Parameters:
props- The decoder configurationtype- The type of objects constructed
-
-
Method Details
-
fromBytes
- Specified by:
fromBytesin interfaceorg.apache.kafka.tools.api.Decoder<T>
-