fastjson JSONObject遍历

    private static String getDesc(String jsonStr, String key) {
        JSONObject jsonObject = JSONObject.parseObject(jsonStr);
        for (Map.Entry entry : jsonObject.entrySet()) {
            if (key.equals(entry.getKey())) {
                return entry.getValue().toString();
            }
        }
        return null;
    }
相关文章
相关标签/搜索