java - json-simple How to get value from index? -
i want value json based on index. code bellow working value string reference.
string s="{\"ga087sh85izetri-123872\":\"0\",\"ga087sh85izetri-123873\":\"-1\",\"ga087sh85izetri-123874\":\"0\",\"ga087sh85izetri-123875\":\"-1\",\"ga087sh85izetri-123876\":\"0\",\"ga087sh85izetri-123877\":\"0\",\"ga087sh85izetri-123878\":\"0\",\"ga087sh85izetri-123879\":\"0\",\"ga087sh85izetri-123880\":\"0\",\"ga087sh85izetri-123881\":\"0\"}"; jsonparser parser2 = new jsonparser(); object objs = parser2.parse(s); jsonobject jsonobject2 = (jsonobject) objs; system.out.println(jsonobject2.get("ga087sh85izetri-123873"));
i'm lookin way like:
system.out.println(jsonobject2.get(0));
in json-simple, jsonobject extends hashmap:
http://juliusdavies.ca/json-simple-1.1.1-javadocs/
it's unfortunately not possible value index cause hashmap unordered.
Comments
Post a Comment