Closed codefish1 closed 1 year ago
This is good - I like the option as is. Please update the doc.
Is there a page which describes the various options? All I can see is a link to the RecordBuilder annotation to view the javadoc in there
Is there a page which describes the various options? All I can see is a link to the RecordBuilder annotation to view the javadoc in there
I guess not.
Thanks for the submission
The use case
Ensure people use the static builder and don't new up the record directly by restricting access to the records constructor. This becomes more important when 50+ developers are working on the same code base, by using the compiler to help enforce the stylist approaches.
Why Do we need this?
Currently with records we can't make the constructor private, it will have the same visibility as the record it's self. In addition when using this library, the static builder will also have the same visibility as the record.
What does this PR add?
This PR enables you to configure the modifiers on the static builder such that you can set the static builder to have a public modifier whereas the record is package-protect, so when your records are in a domain package they can't be accessed directly and new'ed up.
Discussion points
Outstanding work
Assuming you are happy with the principle and approach, I need to update the documentation.