Open irnbrux opened 1 year ago
So what's the requirement here? You want access to the builder's fields before calling the constructor, and that's not possible because they are private? But why can't you do that in your constructor?
I'm asking because your suggested solution won't work: Your custom build
method in the abstract class will never be called, even if you could add it.
The @SuperBuilder does not check if build method is already defined in abstract Builder
This code does not compile because @SuperBuilder adds another public abstract C build(); into the Builder:
Compiler error:
Here is the corresponding delombok code:
The expected result is, that @SuperBuilder does not add build() method to Builder in case another method with name "build()" is already present. Ideally also a warning can be raised in order to make aware of the fact a build() method is already present.
lombok: 1.18.26 openjdk version "14.0.2" 2020-07-14 OpenJDK Runtime Environment AdoptOpenJDK (build 14.0.2+12) OpenJDK 64-Bit Server VM AdoptOpenJDK (build 14.0.2+12, mixed mode, sharing)
Thanks.
Cheers Brian