You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Benedikt Ritter (JIRA)" <ji...@apache.org> on 2015/04/27 11:46:38 UTC

[jira] [Resolved] (LANG-1117) Want an implemention of ToStringBuilder supports annotation

     [ https://issues.apache.org/jira/browse/LANG-1117?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benedikt Ritter resolved LANG-1117.
-----------------------------------
    Resolution: Duplicate

Resolving this as duplicate

> Want an implemention of ToStringBuilder supports annotation
> -----------------------------------------------------------
>
>                 Key: LANG-1117
>                 URL: https://issues.apache.org/jira/browse/LANG-1117
>             Project: Commons Lang
>          Issue Type: Wish
>          Components: lang.builder.*
>    Affects Versions: 3.4
>            Reporter: Jack Tan
>              Labels: features
>
> When using {{ReflectionToStringBuilder}}, we need call {{ReflectionToStringBuilder.setExcludeFieldNames(str1,str2)}} to exclude fields. Why not use annotation? Just look like:
> {code:title=Bar.java|borderStyle=solid}
> public class Bar {
>     private String name;
>     private Date signDate;
>     private int age;
>     @ExcludeFields({"signDate", "age"})
>     public String toString() {
>         return AnnotationToStringBuilder.toString(this, ToStringStyle.JSON_STYLE);
>     }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)