abstract class BaseSerde<T> : Serde<T>, Serializer<T>, Deserializer<T>
BaseSerde combines Serde, Serializer, and Deserializer into a single unit and fixes type information for Kotlin. One should not program against this directly, however, it is a convenient basis for writing Kafka Serdes for other types that you might require in your code base.
See Also
BaseSerde()
BaseSerde combines Serde, Serializer, and Deserializer into a single unit and fixes type information for Kotlin. One should not program against this directly, however, it is a convenient basis for writing Kafka Serdes for other types that you might require in your code base. |
open fun close(): Unit
Close this Serde/Serializer/Deserializer and frees any currently held resources. This method must be idempotent because it might be called multiple times. |
|
open fun configure(config: Map<String, *>, isKey: Boolean): Unit
Configure this object, which will configure the underlying Serializer and Deserializer. |
|
fun deserialize(topic: String, data: ByteArray?): T?
|
|
fun deserializer(): Deserializer<T>
Get the underlying Deserializer |
|
abstract fun doDeserialize(topic: String, data: ByteArray): T
Extending classes must implement this function to convert the ByteArray back to its original type T. |
|
abstract fun doSerialize(topic: String, data: T): ByteArray
Extending classes must implement this method to convert data of type T to a ByteArray. |
|
fun serialize(topic: String, data: T?): ByteArray?
|
|
fun serializer(): Serializer<T>
Get the underlying Serializer |
class NativeSerde<T> : BaseSerde<T>
NativeSerde decorates Kafka Serdes and allows direct access to its Serializer and Deserializer functions. |
|
class ProtoSerde<T> : BaseSerde<T>
The ProtoSerde class is a Kafka Serde/Serializer/Deserializer for Proto, version 2 and 3, objects. |