title: How do you deserialize JSON in java, using JSON.org
body: <p>I am using "org.json" for JSON. I am able to serialize any class into a JSON string, using JSONObject. However, I'm not sure how to go the other way. How does one Deserialize a JSON string back into a class instance?</p>
  
  <p>This code works to serialize it. I use JSONObject, and I provide a list of field names as a second argument to the constructor - User.JSONFieldMap().</p>
  
  <pre><code>    int randomValue = rnd.nextInt(10000);
      String userName = "JavaUnitTest_" + randomValue;
      User newUser = new User();
      newUser.UserName = userName;
      newUser.DisplayName = "Java Unit Test";
      newUser.EmailAddress = userName + "@SomeDomainName.com";
      JSONObject jsonUser = new JSONObject(newUser, User.JSONFieldMap());
      String userStringified = jsonUser.toString();
  </code></pre>
  
  <p>I'm not sure how, or if it is possible to be able to do something like this:</p>
  
  <pre><code>    User myUser = MagicJSONDeserializer.DeserializeIt("{ some JSON string}");
  </code></pre>
  
  <p>Thanks for any help, I come from a .net/C#/Microsoft background, so Java is very new to me.</p>