title: Parsing nested objects with Jackson
body: <p>I am using Robospice + Retrofit + Jackson. I have not plain class which has another class object as a field. I need to parse json and create class with field.<br>
  Here is my class </p>
  
  <pre><code>@JsonIgnoreProperties(ignoreUnknown=true)
  public class User implements UserInformationProvider {
      @JsonProperty("customer_id")
      public int id;
      @JsonProperty("firstname")
      public String firstName;
      @JsonProperty("lastname")
      public String lastName;
      @JsonProperty("email")
      public String email;
      @JsonProperty("telephone")
      public String phone;
      @JsonProperty("token_api")
      public String token;
      @JsonProperty("token_expire")
      public int tokenExpireTime;
      public UserPreferences userPreferences;
      @Override
      public String getUserFirstName() {
          return firstName;
      }
  
      @Override
      public String getUserLastName() {
          return lastName;
      }
  
      @Override
      public String getUserEmail() {
          return email;
      }
  
      @Override
      public String getUserIconUrl() {
          return null;
      }
  }
  </code></pre>
  
  <p>And preferences class  </p>
  
  <pre><code>public class UserPreferences {
      public boolean offersNotifications;
      public boolean statusChangedNotifications;
      public boolean subscriptionNotifications;
      @JsonProperty("new_offers")
      public boolean newOffersNotify;
      @JsonProperty("order_status_changed")
      public boolean orderStatusChangedNotify;
      @JsonProperty("hot_offers")
      public boolean hotOffersNotify;
  }
  </code></pre>
  
  <p>Request that I need to parse into POJO.</p>
  
  <pre><code>{
      "customer_id": 84,
      "token_api": "ef5d7d2cd5dfa27a",
      "token_expire_unix": "1435113663",
      "preferences": {
          "new_offers": "1",
          "order_status_changed": "1",
          "hot_offers": "1"
      }
  }
  </code></pre>
  
  <p>Please help, how can I do this using Jackson. I would be very grateful for any help. Thanks in advance.</p>