title: How to deserialize this json with Gson?
body: <p>I am going to deserialize this <code>json string</code> with <code>Gson</code>      </p>
  
  <pre><code>       {
      "ads": [
          {
              "ad": {
                  "id": 1,
                  "title": "...",
                  "publicImage": "...",
                  "publicUrl": "...",
                  "adposition": {
                      "name": "home"
                  },
                  "ttl": 30,
                  "debug": false
              }
          },
          {
              "ad": {
                  "id": 2,
                  "title": "...",
                  "publicImage": "...",
                  "publicUrl": "...",
                  "adposition": {
                      "name": "splash"
                  },
                  "ttl": 30,
                  "debug": false
              }
          },
          {
              "ad": {
                  "id": 3,
                  "title": "...",
                  "publicImage": "...",
                  "publicUrl": "...",
                  "adposition": {
                      "name": "home"
                  },
                  "ttl": 30,
                  "debug": false
              }
          }
      ],
      "message": "issue list generated",
      "status": "success"
  }
  </code></pre>
  
  <p>and what I have create for classes is (getter setter has been removed) :</p>
  
  <pre><code>public class Ad {
  
      public class AdPosition{
  
          private String mName;
  
          public String getName() {
              return mName;
          }
          public void setName(String name) {
              mName = name;
          }
  
      }
  
      @SerializedName("id")
      private int mID; 
      @SerializedName("title")
      private String mTitle; 
      @SerializedName("publicImage")
      private String mPublicImage; 
      @SerializedName("publicUrl")
      private String mPublicUrl; 
      @SerializedName("ttl")
      private int mTtl; 
      @SerializedName("adposition")
      private AdPosition mAdPosition;     
  }
  </code></pre>
  
  <p>and </p>
  
  <pre><code>public class AdsListResponse {
  
      @SerializedName("ads")
      private List&lt;Ad&gt; mAds;
      @SerializedName("message")
      private String mMessage;
      @SerializedName("status")
      private String mStatus;
  }
  </code></pre>
  
  <p>and for converting I use below code</p>
  
  <pre><code>        Gson gson = new GsonBuilder().setPrettyPrinting().create();
          AdsListResponse ads = gson.fromJson(response, AdsListResponse.class);
  
          for(Ad ad : ads.getAds()){
              if(ad.getAdPosition().getName().equalsIgnoreCase("splash")){
                  System.out.println(ad.getAdPosition().getName());
          }
  </code></pre>
  
  <p>But my list contains objects(Ad) but every field of them is null, for example it has 3 ad but id,title,... are all null, what should I do?</p>
  
  <p><strong>Sorry I copied and paste it wrongly, but still the problem is there, my list of Ad contains Ad but each field of Ad is null</strong></p>