contentful / vault

Easy persistence of Contentful data for Android over SQLite.
https://contentful.github.io/vault/
Apache License 2.0
85 stars 19 forks source link

Kotin data class support #147

Closed dbacinski closed 5 years ago

dbacinski commented 6 years ago

To use Kotlin data classes I have to declare them as:

@ContentType("contactDetail")`
data class ContactDetail(
    @JvmField @Field var type: String = "",
    @JvmField @Field var text: String = ""
) : Resource()

Would be great to:

  1. remove no-arg constructor requirement
  2. remove public field requirement
  3. add support for immutable fields without setter

With those requirements fulfilled we would be able to declare immutable data class like this:

@ContentType("contactDetail")`
data class ContactDetail(
    @Field val type: String,
    @Field val text: String
) : Resource()
mariobodemann commented 5 years ago

Hello,

sorry for the incredible delay, in case you are still interested, I'm coming back with bad news: Right now we have no plans on supporting data classes.

Greetings, Mario