Skip to content

Instantly share code, notes, and snippets.

@tao-qian
Created August 31, 2016 17:33
Show Gist options
  • Save tao-qian/8742281e75cdcb8512849350d8386f3a to your computer and use it in GitHub Desktop.
Save tao-qian/8742281e75cdcb8512849350d8386f3a to your computer and use it in GitHub Desktop.
{{#model}}
public static class Builder {
{{#vars}}
private {{{datatypeWithEnum}}} {{name}};
{{/vars}}
{{#vars}}
public Builder {{name}}({{{datatypeWithEnum}}} {{name}}) {
this.{{name}} = {{name}};
return this;
}
{{/vars}}
public {{classname}} build() {
{{classname}} temp = new {{classname}}();
{{#vars}}
temp.{{name}} = this.{{name}};
{{/vars}}
return temp;
}
}
{{/model}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment