-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
New features for @FieldNameConstants #1774
Comments
There's a pretty serious problem we can't solve in lombok, which is the following: javac will abort early with an error, before it even runs any annotation processors, if you have a NAMED static import which doesn't exist yet because lombok would generate it. So, given:
if you then, in another source file you compile at the same time as above, try: Now back to this issue: I've made a proof of concept for this setup and you can then write This is awesome. Therefore, 2 things: [1] We shall be adding this to lombok soon, and |
That's a good news! Maybe it'd make sense to name it The only usage problem, I can see, is that @rzwitserloot Above, you wrote
|
Implementation is now on master branch: 3d432c3 along with the docs: 0038b48 Because the feature is in experimental I decided (for now, we can revisit this decision prior to releasing v1.18.4) to just remove the old way entirely and replace it with this new way. You can now choose whether you want an enum or an inner type with psf String constants; by default you get the string constants, you have to explicitly choose to go with enum instead. Only configurable aspect right now is the name of the inner type. I can see adding 'uppercased' as an option via lombok.config, but piling it into the annotation itself feels like a bridge too far (too many finicky settings, and it's purely a style thing; I don't think any framework demands that these are capitalized). |
is it possible to have this configurable so:
will turn to
?
and enum Fields, "Fields" make this configurable...
The text was updated successfully, but these errors were encountered: