Hi, everyone Is there a way to ignore a property o...
# announcements
o
Hi, everyone Is there a way to ignore a property on
toString()
when using
data class
? Something like an annotation...
or only overriding it?
a
yes, you need to override it
o
okay, thx
a
You could define it outside of the constructor and inside the class itself, but that means it will be excluded from equals/hash code as well. Don't know your use case, might not be okay, but wanted you to know.
o
yeap, it's a good option as well I personally think it's even painless than override toString
but depends on the scenario etc thanks!
👍 1