Is there a way to use an automatic builder to create builder (Joshua Bloch's Builder Pattern) for classes in Eclipse
? For example an option in the menu, a plugin or something else. I could not find anything under "Refactor
".
You may want to look at lombok annotations to generate builders without the boiler plate code. For example:
@Builder public class MyPojo { private String name; } MyPojoBuilder.builder().name("yourame").build();
The limitation is that this doesn't seem to work with abstract classes.
Maybe I am late to the party.
Eclipse on its own does not provide a way to generate code to support builder pattern. However it can be extended through plugins to enhance the functionality.
There is this plugin that I use this:
https://github.com/henningjensen/bpep
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With