Re: Create flow to only reflect selected fields on ReflectionToStringBuilder

2021-12-14 Thread Daniel Augusto Veronezi Salvador
Hi, As explained in the thread, currently ReflectionToStringBuilder does not have ways to print only selected fields. I would like to know what the community think about the proposal (considering that it only adds a functionallity, with clean code, documentation and unit tests). Best regards

Re: Create flow to only reflect selected fields on ReflectionToStringBuilder

2021-07-26 Thread Daniel Augusto Veronezi Salvador
Hello, is there any update about this? Best regards, Daniel Salvador On 08/07/2021 09:43, Daniel Augusto Veronezi Salvador wrote: Thanks for the reply Mark, I showed you parts of the snippet to avoid a long reply, but I think it turn it confusing. Here is the the full snippet (the comments

Re: Create flow to only reflect selected fields on ReflectionToStringBuilder

2021-07-08 Thread Daniel Augusto Veronezi Salvador
Thanks for the reply Mark, I showed you parts of the snippet to avoid a long reply, but I think it turn it confusing. Here is the the full snippet (the comments are the results):         Example example = new UseCase.Example();         example.setA("test");         example.setB(1);         ex

Re: Create flow to only reflect selected fields on ReflectionToStringBuilder

2021-07-08 Thread Mark Dacek
I'm not sure whether the example given is indicative of all of your use cases, but calling* setExcludeNullValues(true)* would accomplish your above goal. On Wed, Jul 7, 2021 at 6:57 PM Daniel Augusto Veronezi Salvador < dvsalvador...@gmail.com> wrote: > Thanks for the reply Rob, > > To examplify

Re: Create flow to only reflect selected fields on ReflectionToStringBuilder

2021-07-07 Thread Daniel Augusto Veronezi Salvador
Thanks for the reply Rob, To examplify what I mean: We have a class with 7 attributes: a, b, c, d, e, f. Example example... example.setA("test"); example.setB(1); ... example.setE(false); ... We need to print only "a", "b" and "e"; According with your suggestion, it would be: ToStringBuilde

Re: Create flow to only reflect selected fields on ReflectionToStringBuilder

2021-07-02 Thread Rob Spoor
If you know the fields, why use ReflectionToStringBuilder? Why not use a regular ToStringBuilder? That allows you to append each field you want. Yes, you have to type each field name twice (for the name and the value), but is that so much more work that it would require complicating the Reflect

Create flow to only reflect selected fields on ReflectionToStringBuilder

2021-07-02 Thread Daniel Augusto Veronezi Salvador
Hello, This is my first interaction with this community, so I may commit some mistakes 😁. *ReflectionToStringBuilder* has methods to exclude fields from *toString*; If we have an object with several fields and want to reflect only a some, we have to list all the fields that we don't want to