java - How to get just the name of a name-value pair in JSON -


for student project given list of json strings have include given name-value pairs. validate if incoming json string fits 1 of these trying compare names of incoming json string existing ones.

example:

{  "type"  :  "login" ,  "nick"  :  "max" ,  "group"  :  "sales" ,  } 

how can name, in case "type", "nick" or "group?

deserialize json map call keys()

  type type = new typetoken<map<string, string>>(){}.gettype();   gson gson = new gson();   map<string,string> map = gson.fromjson(jsonstring, type);   // call map.keys() 

Comments

Popular posts from this blog

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Magento/PHP - Get phones on all members in a customer group -

session - Logging Out Using PHP -