Randgalt / record-builder

Record builder generator for Java records
Apache License 2.0
758 stars 55 forks source link

Staged builders are not generated for records having only a single field #177

Closed gabrielshanahan closed 7 months ago

gabrielshanahan commented 7 months ago

This is problematic because the main reason you want to use staged builders is so you get a compile-time error if you add a (non-nullable) field to the record, but forget to specify it in the builder. This can happen as easily when you add a second field as it can when you add a third, fourth, or first one for that matter. Staged builders should be generated in all cases.