FieldNameConstants Experimental

50 views
Skip to first unread message

Axel-F B

unread,
Mar 18, 2021, 6:27:40 AM3/18/21
to Project Lombok
Hi everyone! 

we really like Lombok and we just found the FieldNameConstants Feature, which is still experimental and has a call to provide Feedback ;-) 

So i just wanted to say I really like this Feature because it helps us in:
- consolidating these constants in a place where they belong automagically: the POJO itself
- making it compile time safe for refactorings to the fields
- prevent to type them by hand or place them anywhere else which makes way for human error

We use it a to provide Messages for Validation Errors, configure Mappers, and hopefully more to come.

Thanks for you work!
Axel

Danilo Turina

unread,
Nov 18, 2021, 10:20:53 AM11/18/21
to Project Lombok
Hi all,
    first of all a big thank to the people developing Lombok: great job!
Then, I would like to join Axel in pleading the case of FieldNameConstants, since I've found it extremely useful in at least a couple of use cases.

They have been already mentioned, but I'd like to highlight them:
  • messages for validation errors (e.g. in case of API implementation, passing to the client the name of the DTO attribute that failed the validation)
  • mapper configuration
Using FieldNameConstants helps us in moving at compile time the discovery of errors that could only be found at run-time (hopefully during test phase, but, at worst, in production).

Thank you again for Lombok and keep doing it!

Danilo

Reply all
Reply to author
Forward
0 new messages