After parsing an object the string values are automatically changed to double values. Any workaround for the same
JSONObject elementInfo = obj.getElementInfo();
System.out.println("get elementInfo ---> "+elementInfo.get("info"));
//mapping
ArrayList<Object> getEle = gson.fromJson((String) elementInfo.get("info"), ArrayList.class);
System.out.println("After mapping getele----> "+getEle);
Result
get elementInfo ---> [{noOfBins=2, indices=[1, 3]}, {noOfBins=3, indices=[2]}]
After mapping getele----> [{noOfBins=2.0, indices=[1.0, 3.0]}, {noOfBins=3.0, indices=[2.0]}]
Even after mapping how will I get the exact value? Need to get it as
[{noOfBins=2, indices=[1, 3]}, {noOfBins=3, indices=[2]}]