vendredi 3 décembre 2021

How to get value of KProperty1

I have an object

I try to get access to field "english"

val englishSentence = dbField::class.declaredMemberProperties.filter { it.name == "english" }[0]

But when I

model.addAttribute("sentence", englishSentence)

I get val com.cyrillihotin.grammartrainer.entity.Sentence.english: kotlin.String

while I expect bla





Aucun commentaire:

Enregistrer un commentaire