way-auto-optional.Pojo.mustache Maven / Gradle / Ivy
package {{superClass.package.name}};
{{#imports}}
import {{qualifiedName}};
{{/imports}}
@javax.annotation.Generated("br.com.objectos.way.auto.optional.AutoOptionalProcessor")
final class {{superClass.name}}Pojo extends {{superClass.name}} {
{{#methods}}
private final {{{returnType.name}}} {{fieldName}};
{{/methods}}
{{#constructors}}
public {{superClass.name}}Pojo({{superClass.name}}BuilderPojo builder) {
super({{#parameters}}builder.{{parameter.name}}(){{^last}}, {{/last}}{{/parameters}});
{{#methods}}
{{fieldName}} = builder.{{name}}();
{{/methods}}
}
{{/constructors}}
{{#isTestable}}
@Override
public boolean isEqual({{testableOf.name}} o) {
{{#inherited}}
if (!{{superClass.name}}Pojo.class.isInstance(o)) {
return false;
}
{{/inherited}}
{{superClass.name}}Pojo that = {{superClass.name}}Pojo.class.cast(o);
return Testables.isEqualHelper()
{{#methods}}
.equal(this.{{fieldName}}, that.{{fieldName}})
{{/methods}}
.result();
}
{{/isTestable}}
{{#methods}}
@Override
{{#access}}{{declaration}}{{/access}}{{{returnType.name}}} {{name}}() {
return {{fieldName}};
}
{{/methods}}
}