users@jaxb.java.net

Re: ToString plugin

From: Aleksei Valikov <valikov_at_gmx.net>
Date: Thu, 14 Sep 2006 20:06:53 +0200

Hi.

> FYI, you can reuse HashCodeBuilder & EqualBuilder without using
> reflection. Examples below.
>
> Hanson
>
> @Override
> public boolean equals(Object o) {
> if (!(o instanceof Foo))
> return false;
> Foo that = (Foo)o;
> return new org.apache.commons.lang.builder.EqualsBuilder()
> .append(this.id <http://this.id>, that.id
> <http://that.id>)
> .isEquals();
> }
>
> @Override
> public int hashCode() {
> return new org.apache.commons.lang.builder.HashCodeBuilder()
> .append( this.id <http://this.id>)
> .toHashCode();
> }

Yes, I've seen that.
I'll consider using commons-lang.
Thanks for hints.

Bye.
/lexi