[ 
https://issues.apache.org/jira/browse/LANG-1662?focusedWorklogId=713050&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-713050
 ]

ASF GitHub Bot logged work on LANG-1662:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 21/Jan/22 19:43
            Start Date: 21/Jan/22 19:43
    Worklog Time Spent: 10m 
      Work Description: rafaelweingartner commented on a change in pull request 
#849:
URL: https://github.com/apache/commons-lang/pull/849#discussion_r789948481



##########
File path: 
src/main/java/org/apache/commons/lang3/builder/ReflectionToStringBuilder.java
##########
@@ -385,6 +385,19 @@ public static String toStringExclude(final Object object, 
final Collection<Strin
         return toStringExclude(object, toNoNullStringArray(excludeFieldNames));
     }
 
+    /**
+     * Builds a String for a toString method with only the selected field 
names.
+     *
+     * @param object
+     *            The object to "toString".
+     * @param selectedFieldNames
+     *            The field names that must be on toString. Null selects 
nothing.

Review comment:
       I see. Can you add these details in the JavaDocs? When reading I got the 
impression that Null would return an empty string.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

            Worklog Id:     (was: 713050)
    Remaining Estimate: 5h 20m  (was: 5.5h)
            Time Spent: 40m  (was: 0.5h)

> Create methods on ReflectionToStringBuilder to reflect only select fields
> -------------------------------------------------------------------------
>
>                 Key: LANG-1662
>                 URL: https://issues.apache.org/jira/browse/LANG-1662
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.builder.*
>            Reporter: Daniel Augusto Veronezi Salvador
>            Priority: Minor
>   Original Estimate: 6h
>          Time Spent: 40m
>  Remaining Estimate: 5h 20m
>
> *ReflectionToStringBuilder* has methods to exclude fields from *toString*; If 
> we have an object with several fields and want to reflect only a fews, we 
> have to list all the fields that we don't want to reflect and pass to 
> *excludeFieldNames*.
> Would be valid implement a way to pass the fields that we want and reflect 
> only the selected fields?
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to