Andreas Andreakis wrote:

I agree, that it is not a beautiful solution.

But the problem is, that you can“t tell if two Objects are equal if you dont define equals() , hashcode() on your own. How will your dublication-preventing Rule look like ?

I would simply implement the equal and hashcode methods :-)
It is general good practice to do so and it is quite easy: an equals method is almost trivial, and for the hashcode you can use e.g. http://www.javapractices.com/Topic28.cjp if you want...


Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

Reply via email to