way-auto-builder.Builder.mustache Maven / Gradle / Ivy
package {{superClass.package.name}};
{{#imports}}
import {{qualifiedName}};
{{/imports}}
@javax.annotation.Generated("br.com.objectos.way.auto.AutoBuilderProcessor")
abstract class {{superClass.name}}Pojo
implements
{{superClass.name}},
{{#innerInterfaces}}
{{^last}}
{{name}},
{{/last}}
{{#last}}
{{name}} {
{{/last}}
{{/innerInterfaces}}
{{#methods}}
{{#parameters}}
{{#parameter}}
private {{{type.name}}} {{methodName}};
{{/parameter}}
{{/parameters}}
{{/methods}}
{{#methods}}
@Override
public {{{returnType.name}}} {{name}}({{#parameters}}{{#parameter}}{{{type.name}}} {{methodName}}{{/parameter}}{{/parameters}}) {
{{#parameters}}
{{#parameter}}
{{^type.primitive}}
if ({{methodName}} == null) {
throw new NullPointerException();
}
{{/type.primitive}}
this.{{methodName}} = {{methodName}};
{{/parameter}}
{{/parameters}}
return this;
}
{{/methods}}
{{#methods}}
{{#parameters}}
{{#parameter}}
{{{type.name}}} {{methodName}}() {
return {{methodName}};
}
{{/parameter}}
{{/parameters}}
{{/methods}}
}