https://kotlinlang.org logo
#android
Title
# android
r

rbares

04/05/2020, 8:28 PM
I would imagine this initial null is because you aren't yet intending to store the class. It sounds like this would be better achieved with a separate data class which has some nullable fields, which can then be marshalled to/from the entity. If there is some reason you absolutely have to do this, you can achieve similar with a secondary constructor and additional fields outside the primary constructor - but it will be ugly and the potential misuse of the partially-initialized object will make it error prone