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

Builder should throw an error if required fields are not set. #39

Closed Zegveld closed 11 months ago

Zegveld commented 11 months ago

Some objects have required fields, for example in a constructor like this:

class MyClass {
    private final String field;
    MyClass(String field) {
        this.field = field;
    }
}

when using a builder without that field it would be good for an exception to be thrown:

new MyClassBuilder().build();