title: JSON objects in Retrofit 2.1 using Serialization
body: <p>I am using Retrofit Library for Async request But before that I need to convert Json into java objects. I have seen few tutorials and was able to understand. I then decided to do a project on my own using Nomadlist api, the json link is <a href="https://nomadlist.com/api/v2/list/cities/mumbai-india/places/work" rel="nofollow noreferrer">https://nomadlist.com/api/v2/list/cities/mumbai-india/places/work</a></p>
  
  <p>I am confused how to make getters and setters object </p>
  
  <pre><code>"updated":{"epoch":1473220041,"time":"2016-09-07T03:47:21+00:00","cache":false} 
  </code></pre>
  
  <p>or from the result array how to make getters and setter for </p>
  
  <pre><code>"city":{"name":"Thane","slug":"thane-india","url":"\/thane-india"}. 
  </code></pre>
  
  <p>I have made the the following class.</p>
  
  <pre><code>public class City {
  
  @SerializedName("name")
  private String nameNmd;
  
  public String getNameNmd() {
      return nameNmd;
  }
  
  
  @SerializedName("img")
  private String imgNmd;
  
  public String getImgNmd() {
      return imgNmd;
  }
  
  @SerializedName("url")
  private String urlNmd;
  
  public String getUrlNmd() {
      return urlNmd;
  }
  
  @SerializedName("type")
  private String typeNmd;
  
  public String getTypeNmd() {
      return typeNmd;
  }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/c88f5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/c88f5.png" alt="enter image description here"></a></p>
  
  <p>I have added the screenshot of the portion of Json I am using. What would be the correct format for city country and location section.</p>