Reputation: 1665
I have various class in this package. Is it possible to generate hashCode()
and equals()
for all classes in this package at once?
Upvotes: 2
Views: 797
Reputation: 2305
If you need to auto generate hashCode()
and equals()
in eclipse for each class in certain package
Open every java class >>> right click >> sourse >>> generate hashCode()
and equals()
Maybe if the number of classes too big then you can create java task to open every file and append the hashcode() and equals()
Upvotes: 3
Reputation: 1665
Currently Eclipse does not support this feature. Enhancement bug is raised for this.
Upvotes: 0
Reputation: 453
Not Specific for package but apache common's HashCodebuilder and EqualsBuilder can help you to implement it in correct way
Upvotes: 0
Reputation: 2499
can you imagine when you have implementation of "equal()" for classes and you will choose for package "generate please method equal()" what must decide eclipse ? I think if you want to generate a methods automatically for package of classes - you can make own code..
Upvotes: 0