Class SafeDeserializer<T>
- java.lang.Object
-
- io.streamthoughts.azkarra.commons.error.SafeDeserializer<T>
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.apache.kafka.common.serialization.Deserializer<T>
public class SafeDeserializer<T> extends Object implements org.apache.kafka.common.serialization.Deserializer<T>
-
-
Constructor Summary
Constructors Constructor Description SafeDeserializer(org.apache.kafka.common.serialization.Deserializer<T> deserializer, Class<T> type)
Creates a newSafeDeserializer
instance.SafeDeserializer(org.apache.kafka.common.serialization.Deserializer<T> deserializer, T defaultValue)
Creates a newSafeDeserializer
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
{@inheritDocvoid
configure(Map<String,?> configs, boolean isKey)
{@inheritDocT
deserialize(String topic, byte[] data)
{@inheritDocT
deserialize(String topic, org.apache.kafka.common.header.Headers headers, byte[] data)
{@inheritDoc
-
-
-
Constructor Detail
-
SafeDeserializer
public SafeDeserializer(org.apache.kafka.common.serialization.Deserializer<T> deserializer, T defaultValue)
Creates a newSafeDeserializer
instance.- Parameters:
deserializer
- theDeserializer
to delegate.
-
SafeDeserializer
public SafeDeserializer(org.apache.kafka.common.serialization.Deserializer<T> deserializer, Class<T> type)
Creates a newSafeDeserializer
instance.- Parameters:
deserializer
- theDeserializer
to delegate.
-
-
Method Detail
-
configure
public void configure(Map<String,?> configs, boolean isKey)
{@inheritDoc- Specified by:
configure
in interfaceorg.apache.kafka.common.serialization.Deserializer<T>
-
deserialize
public T deserialize(String topic, byte[] data)
{@inheritDoc- Specified by:
deserialize
in interfaceorg.apache.kafka.common.serialization.Deserializer<T>
-
deserialize
public T deserialize(String topic, org.apache.kafka.common.header.Headers headers, byte[] data)
{@inheritDoc- Specified by:
deserialize
in interfaceorg.apache.kafka.common.serialization.Deserializer<T>
-
close
public void close()
{@inheritDoc- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceorg.apache.kafka.common.serialization.Deserializer<T>
-
-