SpringInterfacesSplitResponseEntityNoSwaggerAnnotations.model.mustache Maven / Gradle / Ivy
package {{package}};
{{#imports}}import {{import}};
{{/imports}}
{{#models}}
{{#model}}{{#description}}
/**
* {{description}}
**/{{/description}}
public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {
{{#vars}}{{#isEnum}}
public enum {{datatypeWithEnum}} {
{{#allowableValues}}{{#values}} {{.}}, {{/values}}{{/allowableValues}}
};
private {{{datatypeWithEnum}}} {{name}} = {{{defaultValue}}};{{/isEnum}}{{^isEnum}}
private {{{datatype}}} {{name}} = {{{defaultValue}}};{{/isEnum}}{{/vars}}
{{#vars}}
/**{{#description}}
* {{{description}}}{{/description}}{{#minimum}}
* minimum: {{minimum}}{{/minimum}}{{#maximum}}
* maximum: {{maximum}}{{/maximum}}
**/
@JsonProperty("{{baseName}}")
public {{{datatypeWithEnum}}} {{getter}}() {
return {{name}};
}
public void {{setter}}({{{datatypeWithEnum}}} {{name}}) {
this.{{name}} = {{name}};
}
{{/vars}}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class {{classname}} {");
{{#parent}}sb.append(" " + super.toString()).append("");{{/parent}}
{{#vars}}sb.append(" {{name}}: ").append({{name}}).append("");
{{/vars}}sb.append("}");
return sb.toString();
}
}
{{/model}}
{{/models}}