title: JSON Simple: integer parsing
body: <p>I have a problem parsing JSON integer in my REST service. Parsing String and double type works fine</p>
  
  <p>Working:</p>
  
  <pre><code>JSONParser parser = new JSONParser();
  Object obj = null;
  try {
      obj = parser.parse(input);
  } catch (ParseException e) {
      e.printStackTrace();
  }
  JSONObject jsonObject = (JSONObject) obj;   
  
  //---------------
  String uName = (String) jsonObject.get("userName");
  double iPrice = (Double) jsonObject.get("itemPrice");
  </code></pre>
  
  <p>Not working:</p>
  
  <pre><code>int baskId = (Integer) jsonObject.get("basketId");
  </code></pre>
  
  <p>I tried to convert the <code>basketId</code> in my basket class to String, and then it functions ok, so code is okay, and link is working, however, when I cast it back to int, I get 500 server error. I am using it to create a new basket with some numeric ID, so I use the @POST annotation and the JSON in the payload is as follows:</p>
  
  <pre><code>{"basketId":50}
  </code></pre>
  
  <p>I don't get it...</p>
  
  <p>EDIT:
  I do get it...JSON simple accepts just bigger types of Java primitives, so integer and float are a no-no</p>