Class ObjectMapperSerde<T>

  • All Implemented Interfaces:
    Closeable, AutoCloseable, org.apache.kafka.common.serialization.Serde<T>

    public class ObjectMapperSerde<T>
    extends Object
    implements org.apache.kafka.common.serialization.Serde<T>
    A Serde that (de-)serializes JSON using Jackson's ObjectMapper.
    • Constructor Detail

      • ObjectMapperSerde

        public ObjectMapperSerde​(Class<T> type)
      • ObjectMapperSerde

        public ObjectMapperSerde​(Class<T> type,
                                 com.fasterxml.jackson.databind.ObjectMapper objectMapper)
    • Method Detail

      • configure

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

        public void close()
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
        Specified by:
        close in interface org.apache.kafka.common.serialization.Serde<T>
      • serializer

        public org.apache.kafka.common.serialization.Serializer<T> serializer()
        Specified by:
        serializer in interface org.apache.kafka.common.serialization.Serde<T>
      • deserializer

        public org.apache.kafka.common.serialization.Deserializer<T> deserializer()
        Specified by:
        deserializer in interface org.apache.kafka.common.serialization.Serde<T>