Details
-
Wish
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
3.4
-
None
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
- duplicates
-
LANG-1031 Add annotations to exclude fields from ReflectionEqualsBuilder, ReflectionToStringBuilder and ReflectionHashCodeBuilder
- Closed