Skip to content

Add builder method to create a new instance of the builder #1396

@josejulio

Description

@josejulio

When using (in the context of the maven builder) useInnerClassBuilders and generateBuilders set to true it would be nice to have a builder method to generate a new builder.

i.e.
Instead of:

new MyGeneratedObject.MyGeneratedObjectBuilder()
    .withFoo("bar")
    .build();

Have something like:

MyGeneratedObject.builder()
    .withFoo("bar")
    .build();

It could be an opt-in by a new setting e.g. addBuilderMethodForInnerClassBuilders.

I'm supposing the same applies for the core, but haven't checked all the details other thant the BuilderRule file where I suppose it needs to be modified.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions