If I have the following class
class Item(
id: Long? = null,
var names: List<@Cool String> = emptyList())
How can I extract the @Cool
annotation?
I tried: Item::class.memberProperties.elementAt(0).returnType
which gets me a KType
, but there seems to be no way to get the annotation from it? Even better, is it possible to create an AnnotatedType
from a KType
?
Btw, I already have a way to produce an arbitrary instance of AnnotatedType
(using GeAnTyRef), so if there’s no built-in way to get an AnnotatedType
from KType
, I can still create it myself as long as I can get all the info I need from KType
.