Categories


Authors:
m.jedynak
opensource software

Equals and HashCode Deluxe Generator

Products: IntelliJ IDEA

Vendor: Michal Jedynak

Email: m.jedynak [at] gmail.com

Website: https://github.com/mjedy...sHashCodeDeluxeGenerator

Bugtracker page

Description:

Generates equals() and hashCode() using Guava library or Objects class from Java 7. Usage:
  • ALT + INSERT -> equals() and hashCode() deluxe (inside Java Editor).
Downloads: 13928
Rating:
Participated in rating: 3
Version Since Build Until Build File/URL Size (Kb) Date Details
1.0.9. 133.193. . Download 74.08 2014-02-02 02:11:24 details
1.0.7. 129.354. . Download 73.64 2013-09-28 20:52:44 details
1.0.5. 107.105. . Download 64.58 2013-02-04 20:56:16 details
. .
7 updates are hidden show all updates

Recent change notes:

version 1.0.9
version 1.0.8
version 1.0.7
  • Fixed bug with incorrect class name shown when asking about permission to delete existing equals/hashCode methods
version 1.0.6
version 1.0.5
  • Added ability to choose between Java 7 and Guava
version 1.0.4
  • Added comparison with base class fo subclasses in equals method
version 1.0.3
  • Fixed compatibility issue with IDEA 12
version 1.0.2
  • Tested against IDEA 10.5
version 1.0.1
  • Changed plugin name as slash character ('/') caused a bug with download link on JetBrains site.

General usage instructions:

ALT + INSERT -> equals() and hashCode() deluxe (inside Java Editor)

Comments:

Anonymous
Rated:
2014-03-11 23:58:10
This is great, but is it possible to allow configuration of the style of the equals() method? I personally like to use the following concise style: public boolean equals(Object obj) { if (obj instanceof MyClass) { final MyClass that = (MyClass) obj; return equal(this.field1, that.field1) && equal(this.field2, that.field2) && equal(this.field3, that.field3); } return false; }
.
peternortan
2013-12-19 19:13:17
nice one. Also check out http://muhammadkhojaye.blogspot.com/2010/02/java-hashing.html‎ for more comprehensive example.
.
Anonymous
Rated:
2013-08-03 01:43:44
Makes life a lot easier
.
virgo47
Rated:
2012-11-08 11:56:14
Not bad and does what it should. However, the first dialog in the wizard should have select/unselect all in case one needs to base equals on a single id for instance. Also there is no customization in case you prefer something like: return this == obj || obj != null && getClass() == obj.getClass() && Objects.equal(getPrimaryKey(), ((ConfigData) obj).getPrimaryKey()); ...instead of typical ifs, braces, many lines, etc.
.