Open GoogleCodeExporter opened 8 years ago
It is very easy - declare equals/hashCode/toString in your interface, or if you
have
a class - override Object's ones with abstract. Children will either declare
your
methods, or won't compile.
Original comment by earwin@gmail.com
on 19 Oct 2009 at 11:19
earwin, I think the solution you mentioned with interfaces does not work with
eclipse's 1.6 compiler, and declaring the hashCode, equals (toString) methods as
abstract will require to have helper methods to access the state of the base
classes
in descendents, or an alternative implementation of hashCode, equals (toString)
accessible to descendent classes.
Original comment by aborgabor
on 19 Oct 2009 at 11:45
Original issue reported on code.google.com by
aborgabor
on 23 Jun 2009 at 1:39