Add marker interface for pojos that can be put/get
Could help a bit with type safety
storIo.put()
.`object`(sqlData) //should fail to compile if `SqlData` does not implement the marker interface
.prepare()
.executeAsBlocking()
Hm, interesting idea, but it will forbid you from working with classes that you don't control but have custom adapters for, like classes from libraries.
@nikitin-da thoughts?
@artem-zinnatullin agreed, I can see how that can be a limitation that would outweigh the benefit for users relying on that flexibility.
Here's the use case I was hoping this would solve: I convert my StorIo POJOs into a Kotlin data class, and sometimes I forget to convert the Kotlin data class into the StorIo POJO on put operations.
Yeah, I understand your pain, I catch myself everytime with same problem using Gson and other similar libraries, so I really like your proposal, but we have to check how many users may be affected by such change, since it's not backward compatible at all…
Good idea to move this check to compile time, but marker interface itself will not force you to add type mapping. It looks like excess step and it will be impossible to use entities from libraries =(