Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for excluding fields from generated toString methods #720

Merged
merged 1 commit into from
Apr 26, 2017
Merged

Add support for excluding fields from generated toString methods #720

merged 1 commit into from
Apr 26, 2017

Conversation

driseley
Copy link
Contributor

We need the ability to exclude certain fields ( for example passwords ) from the generated toString methods, as these toString methods are invoked by some logging statements.

This PR adds support for excluding fields by name from the toString method , using the builtin support for this feature in the CommonsLang(3) ReflectionToStringBuilder:

https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/builder/ReflectionToStringBuilder.html#toStringExclude-java.lang.Object-java.lang.String...-

A new optional string array parameter toStringExcludes is added to support this

@thachhoang thachhoang requested review from joelittlejohn and removed request for joelittlejohn April 25, 2017 18:45
@joelittlejohn
Copy link
Owner

This one looks good to me 👍

@joelittlejohn joelittlejohn merged commit fe018d4 into joelittlejohn:master Apr 26, 2017
@joelittlejohn
Copy link
Owner

Thanks for contributing this @driseley!

@driseley
Copy link
Contributor Author

driseley commented Apr 27, 2017

@joelittlejohn - Many thanks for merging this so quickly!

One small thing, I noticed you did a release since I created the PR, so could this line:

https://github.com/joelittlejohn/jsonschema2pojo/blob/master/jsonschema2pojo-maven-plugin/src/main/java/org/jsonschema2pojo/maven/Jsonschema2PojoMojo.java#L225

be updated from @since 0.4.34 to @since 0.4.35 ?

@joelittlejohn
Copy link
Owner

Oh, good spot! I'll fix that.

@joelittlejohn joelittlejohn added this to the 0.4.35 milestone Apr 27, 2017
@driseley
Copy link
Contributor Author

Hi @joelittlejohn,

Do you have any schedule for the 0.4.35 release, we'd love to move our builds back to using the upstream version of your maven plugin?

Many thanks
Dave

@driseley driseley deleted the to-string-exclude branch May 22, 2017 15:48
@joelittlejohn
Copy link
Owner

@driseley I'll do this now.

@driseley
Copy link
Contributor Author

Thanks so much!!!

@joelittlejohn
Copy link
Owner

@driseley 0.4.35 has been released. It should be usable within 10 mins and visible when searching or browsing Maven central within 4 hours. Thanks again for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants