0

I have a data class in Kotlin and I have a property in the class named isFoo, note that it starts with is. Kotlin creates setters differently for fields that start with is as mentioned here due to this I am receiving an error that looks something like this

ClassMapper: No setter/field for isFoo found on class com.domain.appName.models.Settings

How can I overcome this so fields that start with is in the data class are correctly set when using the getValue function of the Realtime Database's DataSnapshot?

Kartik Watwani
  • 629
  • 8
  • 20

1 Answers1

1

You can add a PropertyName annotation on the field and/or accessor methods to control how it is serialized to and deserialized from the database.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807