title: Gson deserialization for Realm list of primitives
body: <p>I am using realm with gson. I have a modal which has a list of int type field. Realm does not support currently list of primitives. To solve this there is a solution. I created my RealmInt class.</p>
  
  <pre><code>import io.realm.RealmObject;
  
  public class RealmInt extends RealmObject {
      private int val;
  
      public int getVal() {
          return val;
      }
  
      public void setVal(int val) {
          this.val = val;
      }
  }
  </code></pre>
  
  <p>I have a big modal object something like that..</p>
  
  <pre><code>public class Product extends RealmObject {
      @PrimaryKey
      private int productID;
      private int priority;
      private boolean isFavourite;
      .....
      .....
      .....
      private RealmList&lt;Document&gt; documents;
      private RealmList&lt;ProductInfoGroup&gt; productInfoGroups;
      private RealmList&lt;RealmInt&gt; categories;
  </code></pre>
  
  <p>I must deserialize the json array below to Product modals.</p>
  
  <pre><code>[{
          "productID": 776,
          "categories": [
              35
          ],
          "name": "",
          "priority": 3,
          ......
          "status": 2,
          "documents": [
              {
                  "documentID": 74,
                  "productID": 776,
                  "name": null,
                  ....
                  "isDefault": true
              }
          ],
          "productInfoGroups": [
              {
                  "productInfoGroupID": 1575,
                  "productID": 776,
                  .....
                  "productInfos": [
                      {
                          "productInfoID": 2707,
                          "productInfoGroupID": 1575,
                          "title": "",
                          ...
                      },
                      {
                          "productInfoID": 2708,
                          "productInfoGroupID": 1575,
                          ...
                      },
                      {
                          "productInfoID": 2709,
                          .....
                      }
                  ]
              }
          ],
          "lastUpdateDate": 130644319676570000,
          "isActive": true
      },....]
  </code></pre>
  
  <p>There is a solution <a href="https://stackoverflow.com/questions/28733024/gson-deserialization-of-liststring-into-realmlistrealmstring">here</a> but it is not for big objects. I need to change only categories array and other deserialization must be done by default gson deserialization.</p>