वरुण
वरुण

Reputation: 1665

How to generate hashCode() and equals() for a package in eclipse?

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

Answers (4)

Ahmad Al-Kurdi
Ahmad Al-Kurdi

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

Max Usanin
Max Usanin

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

Related Questions