Join Slack
Communities
Powered by
How can i exclude data class field from hash code ...
# getting-started
s
Sam Stone
11/24/2022, 3:32 AM
How can i exclude data class field from hash code and equals?
c
Chris Lee
11/24/2022, 3:34 AM
to do so requires overriding equals and hashcode.
j
Jacob
11/24/2022, 4:03 AM
Don't put the field in the constructor
plus one
2
Jacob
11/24/2022, 4:04 AM
But It'll also be excluded from copy and toString
s
Sam Stone
11/24/2022, 6:56 PM
What about if it is in a secondary connector?
j
Jacob
11/24/2022, 7:05 PM
Is only included if it's in the primary constructor
👍 1
71
Views
Open in Slack
Previous
Next