Implementing equals(), hashCode(), toString() & compareTo() using reflection

Apache Commons Lang simplifies method implementation (equals(), hashCode(), etc.) with reflection, albeit with slower performance compared to explicit field usage.

March 1, 2010

Using CompareToBuilder to implement Comparable interface

Apache’s Commons Lang offers CompareToBuilder for streamlined Comparable implementation.

February 27, 2010

Using ToStringBuilder to easily write toString() method

Apache’s Commons Lang’s ToStringBuilder facilitates easy toString() method creation.

February 22, 2010

Using HashCodeBuilder to implement hashCode()

Apache’s Commons Lang offers HashCodeBuilder for streamlined and efficient hashCode() method implementation.

February 15, 2010

Using EqualsBuilder to create equals() method

Apache’s Commons Lang’s EqualsBuilder simplifies proper equals() method implementation.

February 13, 2010