I the class bellow I had to make abstract because I would not find a why to to have the “type” method implemented I has expecting to be able to do something like:
abstract fun type(): T::class.java
But it does not work. and I ended up to have to redefine this method in several classes.
package com.integrando.jurigest.wire.codec
import io.vertx.core.eventbus.MessageCodec
abstract class AutoDiscoverableMessageCodec<T> : MessageCodec<T, T> {
override fun name(): String = javaClass.simpleName
override fun transform(payload: T): T = payload
abstract fun type(): Class<T>
override fun systemCodecID(): Byte = -1
}