-
Notifications
You must be signed in to change notification settings - Fork 54
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 a SimpleToString option #82
Comments
+1 |
I see there is a |
@andrei-ivanov There's nothing to enable, it was never implemented. The class is a copy-paste of The problem with simple At the same time I don't quite understand what is the problem with an additional runtime dependency. I mean, OK, it is better without the runtime dep, but for the price of ugly code in the |
I was thinking the deep-as-possible is probably the wrong approach. A shallow inspection of only immediate member primitive and boxes primitives fields would cover a large number of use cases and allow for a depedency-free model jar. Scenarios that need more than first-level could then opt for the toString strategy and the runtime dependency. Ie only “to string” member fields of these types: String |
@mattrpav This would be much easier but to be honest this is very limited. Would not even cover collections or But I'll think about it. |
@highsource gotcha. Perhaps, for collections a suitable solution for class:
The toString on the collection could be:
I'm fine w/ no support for JAXBElement. I think the idea is to have an option for a bunch of easy use cases to dodge the runtime requirement, but understand that there are corner cases that cause it to jump to the full ToStringStrategy. I could see us using both. We leverege extending the ToStringStrategy to do password and other secret masking, I wouldn't expect that type of functionality in a SimpleString solution. |
Follow up issue : highsource/jaxb-tools#433 |
Closing in favor of follow up issue in jaxb-tools |
The goal would be to have a deep (as possible), reflection-free, runtime-free option similar to the SimpleEquals and SimpleHashcode for toString method creation.
The text was updated successfully, but these errors were encountered: