fastjson将字符串转复杂结构

Map<Integer,List<List<List<Double>>>> geometries=new HashMap<>();
        List<Double> a=new ArrayList<>();
        a.add(1d);
        List<List<Double>> b=new ArrayList<>();
        b.add(a);
        List<List<List<Double>>> c=new ArrayList<>();
        c.add(b);
        geometries.put(2,c);

        String s = JSON.toJSONString(geometries); 
Map<Integer,List<List<List<Double>>>> list = JSON.parseObject(s, new TypeReference<Map<Integer,List<List<List<Double>>>>>(){});

猜你喜欢

转载自blog.csdn.net/qi923701/article/details/107949471