Class ExtendedDeserializer.Wrapper<T>
- java.lang.Object
-
- org.apache.kafka.common.serialization.ExtendedDeserializer.Wrapper<T>
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Deserializer<T>
,ExtendedDeserializer<T>
- Enclosing interface:
- ExtendedDeserializer<T>
public static class ExtendedDeserializer.Wrapper<T> extends 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()
Close this deserializer.void
configure(Map<String,?> configs, boolean isKey)
Configure this class.T
deserialize(String topic, byte[] data)
Deserialize a record value from a byte array into a value or object.T
deserialize(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(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(Map<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(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()
Description copied from interface:Deserializer
Close this deserializer.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 interfaceDeserializer<T>
-
ensureExtended
public static <T> ExtendedDeserializer<T> ensureExtended(Deserializer<T> deserializer)
-
-