All Downloads are FREE. Search and download functionalities are using the official Maven repository.

way-auto-optional.Pojo.mustache Maven / Gradle / Ivy

There is a newer version: 2.2.0
Show newest version
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}}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy