zknill/builder: java builder class code generator

builder generates a class that implements the builder pattern.

The command:

1
builder -s title --class BookTitle

Generates:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
public static class Builder {

    private String title;

    public Builder title(final String title) {
        this.title = title;
        return this;
    }

    public BookTitle build() {
        return new BookTitle(this);
    }
}

There are a number of different flags that represent different variable types, use builder --help for info.

To install, clone or go get the repo. cd into cmd/builder and go install.

https://github.com/zknill/builder