{% for attribute in entity.attributes -%}
{%- if attribute.realm_read_only.size == 0 -%} {%- comment %} ******* CONVERT TYPE CAPTURE ******* {% endcomment -%} {%- capture convert_type -%} {%- if attribute.realm_read_only.size == 0 and attribute.enum_type.size > 0 -%} String {%- else -%} {%- if params.use_wrappers == "true" and attribute.optional == true -%} {%- include 'inc/wrapper_type_converter' -%} {%- else -%} {%- include 'inc/type_converter' -%} {%- endif -%} {%- endif -%} {%- endcapture -%} {%- capture default_value %} {%- if attribute.default.size > 0 %} = {%- if convert_type == "boolean" %} {%- if attribute.default == "YES" %} true {%- else %} false {%- endif %} {%- elsif convert_type == "String" %} "{{ attribute.default }}" {%- else %} {{ attribute.default }} {%- endif %} {%- endif %} {%- endcapture %} {%- capture isPrimitives %} {%- include 'inc/primitives' %} {%- endcapture %} {%- assign name = attribute.name -%} {%- if name == primary_key %} @PrimaryKey {%- endif -%} {%- if attribute.optional == false and attribute.realm_ignored == false and name != primary_key and isPrimitives == "false" %} @Required {%- endif -%} {%- if attribute.indexed == true %} @Index {%- endif -%} {%- if attribute.realm_ignored == true %} @Ignore {%- endif -%} {%- if attribute.json_key_path.size > 0 %} @SerializedName("{{ attribute.json_key_path }}") {%- endif -%} {%- if params.support_annotations.size > 0 and attribute.support_annotation.size > 0 %} @android.support.annotation.{{ attribute.support_annotation }} {%- endif %} private {{ convert_type }} {{ name }}{{ default_value }}; {%- endif -%}
{%- endfor -%}