rigd-loxia / builder-generator

Yet another builder generator. Primary style of this generator will be fluent wither, although other styles will be supported in the future. There is support for builder chaining.
Apache License 2.0
2 stars 2 forks source link

Pick Builder constructor over no-args constructor #40

Open Zegveld opened 11 months ago

Zegveld commented 11 months ago

Given the situation:

class MyClass {
  MyClass() {} // for serialization only
  MyClass(MyClassBuilder builder) {} // for builder usage
}

It is preferred to use the constructor with the builder in it, instead of the no args constructor.