Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 22636 invoked from network); 1 Feb 2010 07:26:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 Feb 2010 07:26:13 -0000 Received: (qmail 18725 invoked by uid 500); 1 Feb 2010 07:26:12 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 18623 invoked by uid 500); 1 Feb 2010 07:26:11 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 18613 invoked by uid 99); 1 Feb 2010 07:26:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Feb 2010 07:26:11 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Feb 2010 07:26:11 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id DF52429A0016 for ; Sun, 31 Jan 2010 23:25:50 -0800 (PST) Message-ID: <768028393.2931265009150909.JavaMail.jira@brutus.apache.org> Date: Mon, 1 Feb 2010 07:25:50 +0000 (UTC) From: "Henri Yandell (JIRA)" To: issues@commons.apache.org Subject: [jira] Updated: (LANG-395) annotations based builders In-Reply-To: <12390691.1199635654020.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LANG-395?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:all-tabpanel ] Henri Yandell updated LANG-395: ------------------------------- Fix Version/s: (was: 3.0) 3.1 Moving to 3.1 as not a backwards-incompatible enhancement, so no need to wo= rk hard to get in 3.0. > annotations based builders > -------------------------- > > Key: LANG-395 > URL: https://issues.apache.org/jira/browse/LANG-395 > Project: Commons Lang > Issue Type: New Feature > Components: lang.builder.* > Reporter: J=C3=B6rg Gottschling > Fix For: 3.1 > > > What about enabling the builders (ToStringBuilder, EqualsBuilder, etc.) t= hat use reflection to use annotations to find the field to include? > Something like: > ToStringBuilder.annotationsBasedToString(Object object, Class= class, Class reflectUpToClass) > One could use the JPA-Annotation @ID for example, espescially for Equals-= and HashCodeBuilder. There should also be some default annotation comming = with LangTwo. > Usage: > public class User > { > @StringRepresentation > @EqualsAndHashCode > private String name > @StringRepresentation > private String email; > private String password; > // ... > @Override > public String toString() > { > return annotationsBasedToString(this); > } > @Override > public boolean equals(Object other) > { > return annotationsBasedEquals(this, other); > } > @Override > public int hashCode() > { > return annotationsBasedHashCode(this); > } > } --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.