Class ExtendedDeserializer.Wrapper<T>
- java.lang.Object
-
- org.apache.kafka.common.serialization.ExtendedDeserializer.Wrapper<T>
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,Deserializer<T>
,ExtendedDeserializer<T>
- Enclosing interface:
- ExtendedDeserializer<T>
public static class ExtendedDeserializer.Wrapper<T> extends java.lang.Object implements ExtendedDeserializer<T>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.kafka.common.serialization.ExtendedDeserializer
ExtendedDeserializer.Wrapper<T>
-
-
Constructor Summary
Constructors Constructor Description Wrapper(Deserializer<T> deserializer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
configure(java.util.Map<java.lang.String,?> configs, boolean isKey)
Configure this class.T
deserialize(java.lang.String topic, byte[] data)
Deserialize a record value from a byte array into a value or object.T
deserialize(java.lang.String topic, Headers headers, byte[] data)
Deserialize a record value from a byte array into a value or object.static <T> ExtendedDeserializer<T>
ensureExtended(Deserializer<T> deserializer)
-
-
-
Constructor Detail
-
Wrapper
public Wrapper(Deserializer<T> deserializer)
-
-
Method Detail
-
deserialize
public T deserialize(java.lang.String topic, Headers headers, byte[] data)
Description copied from interface:ExtendedDeserializer
Deserialize a record value from a byte array into a value or object.- Specified by:
deserialize
in interfaceDeserializer<T>
- Specified by:
deserialize
in interfaceExtendedDeserializer<T>
- Parameters:
topic
- topic associated with the dataheaders
- headers associated with the record; may be empty.data
- serialized bytes; may be null; implementations are recommended to handle null by returning a value or null rather than throwing an exception.- Returns:
- deserialized typed data; may be null
-
configure
public void configure(java.util.Map<java.lang.String,?> configs, boolean isKey)
Description copied from interface:Deserializer
Configure this class.- Specified by:
configure
in interfaceDeserializer<T>
- Parameters:
configs
- configs in key/value pairsisKey
- whether is for key or value
-
deserialize
public T deserialize(java.lang.String topic, byte[] data)
Description copied from interface:Deserializer
Deserialize a record value from a byte array into a value or object.- Specified by:
deserialize
in interfaceDeserializer<T>
- Parameters:
topic
- topic associated with the datadata
- serialized bytes; may be null; implementations are recommended to handle null by returning a value or null rather than throwing an exception.- Returns:
- deserialized typed data; may be null
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Specified by:
close
in interfaceDeserializer<T>
-
ensureExtended
public static <T> ExtendedDeserializer<T> ensureExtended(Deserializer<T> deserializer)
-
-