JSONObjec 转化JSONArray 转化为List<String>

JSONObject 数据格式:{“departments”:[“2c9e86e5756dd678017571f5e8fb004e”]}

需要将上面数据转化为List

JSONArray jsonArray = departments.getJSONArray("departments");
        String dept = JSONObject.toJSONString(jsonArray);
        List<String> department = JSONObject.parseArray(dept,String.class);

你可能感兴趣的:(项目)