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
Setters for java.util.Optional Properties do not allow null Values #1166
Comments
That is correct and is according to design. Use |
Thanks, it works! |
pls, don't cite the "propaganda" B-) If someone doesn't like optionals, s/he can use basically, |
Who decides what propaganda is? But that's not the point. ;-) Optional as result is a good choice for api description and usage. I only ask if you could provide a way to turn it off for setters, maybe with a Style attribute. Automatic property propagation with null values won't work because of method overloading. (Which setter to use?) |
At least for builders. They don't have getters and so the change has no influence to your rule |
I believe this is possible by setting |
Following example:
The generated setters in immutable class and builder doesn't allow null values because of using Objects.requireNonNull.
The text was updated successfully, but these errors were encountered: