do data classes support deep equals (a is equal to...
# announcements
do data classes support deep equals (a is equal to b iff the entire object graph that starts at a and b are equal) ?
It will call
on its parts if thats what you mean.
in nested structures
data class equals will call equals method on all of it's properties (like was said above). If the properties (and their properties...) have correctly implemented equals, then it does work as you would expect
Best would be to read docs about how equals work, how data class generates equals and try it out
I did verify my desired behavior with a couple of unit tests
I just had a gut feeling that equals was not “deep” since some other languages do not help you with this out of the box. With data classes it seems to be fine just out of the box