api-generator-templates/Java/blocks/class/fields.twig

22 lines
689 B
Twig

{%- import '../../utils.twig' as utils -%}
{%- for field in fields %}
{%- if (field.description is not empty) %}
/**
* {{ field.description }}
*/
{%- endif %}
{{ utils.writeNullCheckAnnotation(field.type.type.baseTypeName, field.nullable) }}
{%- if (storageAttributes is not null) %}
{%- if (field.type.storable) %}
@TypeConverters({{ field.type.type.baseTypeName }}.class)
{%- endif %}
{%- if (field.autoGenerate) %}
@PrimaryKey(autoGenerate = true)
{%- endif %}
{%- endif %}
@JsonField(name = "{{ field.jsonName }}")
private {{ utils.formatValueType(field.type.type, field.nullable) }} {{ field.name }};
{%- endfor -%}