dimanche 15 septembre 2019

How to call methods on generic type parameters Kotlin

Is there a way to call methods in a generic class of type F on the same generic type?

In my example F is the generic type parameter, but I don't have any variable declared of this type.

Or is there a way at compile-time to declare a variable which is of the same type parameter F at run time?

    class AggDBTreeImpl<K,V: Serializable,A: 
    Serializable,D,F:Function<V,A,D>> (
        private val url: String,
        private val table: String,
        private val kp: KeyParser<K>
    ): AggDBTree<K,V,A,D,F> where K:Comparable<K>, K: Serializable {

         F.method()
    }





Aucun commentaire:

Enregistrer un commentaire