samedi 18 novembre 2023

Get Type of the properties of a data class Type in Kotlin

Let's say I have the following function in Kotlin

fun getPropertyTypes(dataClassType: Type): List<Type> {

}

And the Type of returnType is a data class in my project. How do I then get the Type of the properties of that data class?

data class ProjectDataClass(
    val pdPropertyResponse: MyResponseClass,
    val pdPropertyError: MyErrorClass,
)




Aucun commentaire:

Enregistrer un commentaire