Community
Participate
Working Groups
If there is an easygoing path to implement builder pattern code would be more valuable. Eg : Like a @Accessors annotation, in one case we add a @Accessors annotation by default a public getter and a public setter method is made @Accessors String name Will compile to java code : private String name; public String getName() { return this.name; } public void setName(final String name) { this.name = name; } In the same manner, if we have an easy way to generate builder pattern code as mentioned below Eg : @Builder class Person { String name } Will compile to java code : public class Person { private String name; public static class Builder { private String name; public Builder withName(String name) { this.name = name; return this; } public Person build() { return new Person(this); } } private Person(Builder builder) { this.name = builder.name; } }
We left this out of 2.7, because there are quite some different flavors of builders, especially how/when required/optional/default parameters are handled. We did not have enough use cases in our own code to make a decision.
In a coming build, can we make a basic builder without much option as mentioned above example.
I don't think we will do that right now, since it has not been requested much. Also, remember that active annotations are easy to write. So if you just need a very basic @Builder, you will be done by the end of the day =)