Skip to content

[REQ] [java] create a builder pattern for the models #18032

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

Closed
jpfinne opened this issue Mar 5, 2024 · 0 comments · Fixed by #18650
Closed

[REQ] [java] create a builder pattern for the models #18032

jpfinne opened this issue Mar 5, 2024 · 0 comments · Fixed by #18650

Comments

@jpfinne
Copy link
Contributor

jpfinne commented Mar 5, 2024

Is your feature request related to a problem? Please describe.

A good builder pattern generation can solve many issues:

  • initialize readonly values in the java generator
  • make it similar to the lombok builder that people are used to.
  • introduce immutability

Lombok can be used the generate builders. But the introduction of lombok creates more issues (#17793)

Describe the solution you'd like

Add a builder inner class
Add a static builder() method
Add a toBuilder() method

Describe alternatives you've considered

Reuse the builder from javaJAXRSServerCodeGen.
Fix the lombok generation issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment