Custom getter/setter for properties created by type params

How can we deal with this when working with data classes?

For data classes all primary constructor parameters need to be marked as val or var. So when I want to have a special setter for one of my (required/non-optional) data class properties, I have to implement equals(), hashCode() toString() etc. on my own or is there another cool way?

3 Likes