Fastjson的使用

Posted by zjh on August 19, 2020

依赖

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

JSON 字符串-》对象转换JSON

ObjectMapper objectMapper = new ObjectMapper();
objectMapper.writeValueAsString(Object);

JSON 字符串-》JSON转换对象

Object=JSON.parseObject(str);