06/27/2019, 3:46 PM
Hello! I'm wondering if anybody knows of a simple way to avoid
data class
duplication when using room. I have a
data class
from a custom library (Kotlin but NOT Android). I have an Android app that uses that library and will store some items of that
data class
. But as far as I can see, I don't find an easy way to create an
from that library
data class
. Any ideas?
I've done a secondary constructor for my entity for now.
data class DataEntity(val value: Int) {
    constructor(data: Data): this(data.value)
I hope it's good enough 😛