Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
说我有一个枚举。
@Enumerated(EnumType.STRING) private Gender gender;
jackson json 解析器能否从 json 字符串中设置此值?
是的。验证这一点的一种方法是序列化 POJO 值,看看会发生什么。默认情况下, enum.name() 用作序列化,预期用于反序列化。