Over a million developers have joined DZone.

JAU (Java Annotation Based Utilities) 1.0

DZone's Guide to

JAU (Java Annotation Based Utilities) 1.0

Free Resource

JAU 1.0 is ready for download from the project site: http://code.google.com/p/jau/.

The library will help you to implement common methods like .equals() or .hashCode() using annotations.


As promised in my last post, I did some performance analysis and here are results for toString() on this "real life" class (lower bar is better). The full performance report is here.

JAU toString() performance on a

As expected, manually implemented methods are faster than JAU (which uses reflection).

  • for "small" field types (byte, int, float) performance of equals()/hashCode() implemented with JAU depends heavily on the number of fields and is much worse than in manually implemented methods
  • for an object with one String field the value of the field must be of length 500 or higher for JAU overhead to become neglectable
  • toString() performance of JAU is really good even for classes with many small fields

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}