users@jaxb.java.net

Re: ToString plugin

From: Hanson Char <hanson.char_at_gmail.com>
Date: Thu, 14 Sep 2006 08:06:46 -0700

Hi Aleksei,

I see. So you want to build your own implementation of equals and hashCode
for each pojo ? That's good too, but is there a compelling reason for that
? In case you are not aware, a one-liner can be used:

@Override
public boolean equals(Object that) {
    return org.apache.commons.lang.builder.EqualsBuilder.reflectionEquals(this,
that);
}

@Override
public int hashCode() {
    return
org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode(this);
}

Hanson

On 9/14/06, Aleksei Valikov <valikov_at_gmx.net> wrote:
>
> Hi Hanson,
>
> > Excellent. Why not just make use of the Jakarta commons' EqualBuilder
> > and HashcodeBuilder ? Those I suppose they are widely used and
> > therefore widely tested.
>
> Well, this is an option. I don't use these builders myself, so
> contributions are
> welcome.
>
> > The rest is just about hosting your plugin under the "right" categories
> > so people can find them.
>
> Also reasonable.
>
>
> Bye.
> /lexi
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>