How to iterate a JsonObject (gson)

前端 未结 5 1148
有刺的猬
有刺的猬 2021-02-19 08:50

I have a JsonObject e.g

JsonObject jsonObject = {\"keyInt\":2,\"keyString\":\"val1\",\"id\":\"0123456\"}

Every JsonObject contains

5条回答
  •  臣服心动
    2021-02-19 09:43

    I am not quite sure why you want to do manual manipulation in the first place. GSON decode will simply leave those absent key/value pairs as default value (zero,null). And then you can process as you want.

提交回复
热议问题