Harnick
03/17/2023, 3:55 PMSettingsCollection
as a parameter, but from what I understand, KotlinX.Serialization requires a reified type parameter, which isn't available at the class level. I don't really understand generics and reification if I'm honest. Does anyone have any pointers? Is this even possible?
class SettingsColumnAdapter<T: SettingsCollection>(val collectionType: T) : ColumnAdapter<T, String> {
override fun decode(databaseValue: String): T {
return Json.decodeFromString(databaseValue)
}
override fun encode(value: T): String {
return Json.encodeToString(value)
}
}
DonizeteVida
03/21/2023, 9:17 PMDonizeteVida
03/21/2023, 9:17 PMDonizeteVida
03/21/2023, 9:19 PMDonizeteVida
03/21/2023, 9:21 PM