samedi 29 avril 2017

Kotlin check parameter's type

When working with Java's reflection I can do something like this: method.getParameterTypes()[i] which gives me parameter's i type (Class).

How can I achieve this using Kotlin's KCallable? I've tried doing something like this: callable.parameters[i].type but the only thing I found was type.javaType but it returns Type which didn't help me at all. I also tried parameters[i].kind but that didn't help me at all.

How can I do Java's method.getParameterTypes() using Kotlin's KCallable?





Aucun commentaire:

Enregistrer un commentaire