
{% 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 -%}
            {%- include 'inc/wrapper_type_converter' -%}
          {%- else -%}
            {%- include 'inc/type_converter' -%}
          {%- endif -%}
        {%- endif -%}
      {%- endcapture -%}

      {%- assign name = attribute.name -%}
      {%- if name == primary_key %}
    @PrimaryKey
      {%- 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 == true and attribute.support_annotation.size > 0 %}
    @android.support.annotation.{{ attribute.support_annotation }}
      {%- endif %}
    private {{ convert_type }} {{ name }};
  {%- endif -%}
{%- endfor -%}

{% 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 -%}
            {%- 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 %}
          {%- else %} {{ attribute.default }}
          {%- endif %}
        {%- endif %}
      {%- endcapture %}

      {%- assign name = attribute.name -%}
      {%- if name == primary_key %}
    @PrimaryKey
      {%- 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 == true and attribute.support_annotation.size > 0 %}
    @android.support.annotation.{{ attribute.support_annotation }}
      {%- endif %}
    private {{ convert_type }} {{ name }}{{ default_value }};
  {%- endif -%}
{%- endfor -%}