Class 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 Detail

      • SafeDeserializer

        public SafeDeserializer​(org.apache.kafka.common.serialization.Deserializer<T> deserializer,
                                T defaultValue)
        Creates a new SafeDeserializer instance.
        Parameters:
        deserializer - the Deserializer to delegate.
      • SafeDeserializer

        public SafeDeserializer​(org.apache.kafka.common.serialization.Deserializer<T> deserializer,
                                Class<T> type)
        Creates a new SafeDeserializer instance.
        Parameters:
        deserializer - the Deserializer to delegate.
    • Method Detail

      • configure

        public void configure​(Map<String,​?> configs,
                              boolean isKey)
        {@inheritDoc
        Specified by:
        configure in interface org.apache.kafka.common.serialization.Deserializer<T>
      • deserialize

        public T deserialize​(String topic,
                             byte[] data)
        {@inheritDoc
        Specified by:
        deserialize in interface org.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 interface org.apache.kafka.common.serialization.Deserializer<T>
      • close

        public void close()
        {@inheritDoc
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
        Specified by:
        close in interface org.apache.kafka.common.serialization.Deserializer<T>