fastjson——enum反序列化
官方示例代码:https://github.com/alibaba/fastjson/blob/d141fa171725f1e25e5449378f8a8d8ac323c4ae/src/test/java/com/alibaba/json/bvt/issue_1500/Issue1582.java
enum Size {
Big, Small
}
public class TestEnum {
public static void main(String[] args) {
Size size = JSON.parseObject("\"Big\"", Size.class);
Size size1 = JSON.parseObject("\"Large\"", Size.class);
System.out.println(size);
System.out.println(size1);
}
}
原文:https://www.blog.hiyj.cn/article/detail/70