title: Mapping JSON into POJO using Gson
body: <p>I have the following JSON to represent the server response for a salt request:</p>
  
  <pre><code>{
      "USER":
      {
          "E_MAIL":"email",
          "SALT":"salt"
      },
      "CODE":"010"
  }
  </code></pre>
  
  <p>And i tried to map it with the following POJO:</p>
  
  <pre><code>public class SaltPOJO {
      private String code = null;
      private User user = null;
  
      @Override
      public String toString() {
          return this.user.toString();
      }
  
      public String getCode() {
          return code;
      }
      public void setCode(String code) {
          this.code = code;
      }
      public User getUser() {
          return user;
      }
      public void setUser(User user) {
          this.user = user;
      }
  
      public class User {
          private String e_mail = null;
          private String salt = null;
  
          @Override
          public String toString() {
              return this.e_mail + ": " + this.salt;
          }
          public String getE_mail() {
              return e_mail;
          }
          public void setE_mail(String e_mail) {
              this.e_mail = e_mail;
          }
          public String getSalt() {
              return salt;
          }
          public void setSalt(String salt) {
              this.salt = salt;
          }
      }
  }
  </code></pre>
  
  <p>Now everytime i do this:</p>
  
  <pre><code>Gson gson = new Gson();
  SaltPOJO saltPojo = gson.fromJson(json.toString(), SaltPOJO.class);
  
  Log.v("Bla", saltPojo.toString());
  </code></pre>
  
  <p>The <code>saltPojo.toString()</code> is null. How can i map my JSON into POJO using Gson?
  Is the order of my variables important for the Gson mapping?</p>