-
Notifications
You must be signed in to change notification settings - Fork 55
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
Support staged builder #159
Comments
@reda-alaoui do I understand correctly that this generates a small builder interface for each record component with the return value another small builder interface for the next component until all components have been set then a final build method? |
Yes |
It sounds nice but, tbh, I simply don't have the time. A PR would be welcome and I can help if needed. |
This builder is often called "fluent builder". For most typical (for records) case when all components are required, the code which needs to be generated is simple (simpler than for regular builder) and mostly consists of interface declarations. First version, with traditional
The second version, without
Among other advantages, this technique enforces particular order of initialization, making code management much more convenient. For example, comparing changes in PR. |
Closes #159 New option to have standard builder, staged builder or both
I decided to give it a whirl. Please review: #161 |
Closes #159 New option to have standard builder, staged builder or both
Closes #159 New option to have standard builder, staged builder or both
Closes #159 New option to have standard builder, staged builder or both
Closes #159 New option to have standard builder, staged builder or both
Closes #159 New option to have standard builder, staged builder or both
Something similar to https://immutables.github.io/immutable.html#staged-builder:
The text was updated successfully, but these errors were encountered: