Yeah, I tried to implement isEqualTo(), but I end up with a bunch of nice short methods, that do not belong to my class, and that doesn't look nice. Where should I put it? It would be nice to have some mixin, but I cannot override equals() there, and in that case there will be equals() that calls some methods that I do not see, and by some magic, it later calls isEqualTo().
I like idea with Comparable. It makes sense, but in some situations it is an overkill, I agree.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Yeah, I tried to implement
isEqualTo()
, but I end up with a bunch of nice short methods, that do not belong to my class, and that doesn't look nice. Where should I put it? It would be nice to have some mixin, but I cannot overrideequals()
there, and in that case there will beequals()
that calls some methods that I do not see, and by some magic, it later callsisEqualTo()
.I like idea with
Comparable
. It makes sense, but in some situations it is an overkill, I agree.