I'm implementing this interface (see IndexRecord ) which is a container for a decoded Avro object. It feels like the natural way to represent the record is a data class but I'm getting hung up on the fact that deserializer wants to instantiate my record and iteratively call
put
on each field. Since my data class would need an empty constructor I'd have to set defaults or make all of my fields optional, but neither seems ideal.
Is there some trick or alternative to data classes that I could use or should I just be using a plain old class for this instead?
s
Szymon Jeziorski
09/06/2023, 8:03 AM
Not sure how the deserializer you're using works, but if it uses reflection underneath to instantiate empty object instance I would check if