java-json字符串转object

java-json字符串转object,第1张

            JsonNode resBodyRelate = result.getBody();
            //{"language":null,"type":null,"readCount":3,"viewStatus":"V","secondType":null}
            System.out.println(resBodyRelate.getArray().get(0));
            
            com.alibaba.fastjson.JSONObject itemObjectRelate = JSON.parseObject(resBodyRelate.getArray().get(0).toString());
            String resultStr = itemObjectRelate.get("viewStatus").toString();
            System.out.println(resultStr);

pom依赖


<dependency>
	<groupId>com.alibaba</groupId>
	<artifactId>fastjson</artifactId>
	<version>1.2.73</version>
</dependency>

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/877099.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-13
下一篇 2022-05-13

发表评论

登录后才能评论

评论列表(0条)

保存