Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-1117

Want an implemention of ToStringBuilder supports annotation

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 3.4
    • None
    • lang.builder.*

    Description

      When using ReflectionToStringBuilder, we need call ReflectionToStringBuilder.setExcludeFieldNames(str1,str2) to exclude fields. Why not use annotation? Just look like:

      Bar.java
      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);
          }
      }
      
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jacktan1991 Jack Tan
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: