我正在使用JAVA 1.6和Jackson 1.9.9我有一个枚举
public enum Event {
FORGOT_PASSWORD("forgot password");
private final String value;
private Event(final String description) {
this.value = description;
}
@JsonValue
final String value() {
return this.value;
}
}
我添加了一个@JsonValue,这似乎可以将对象序列化为:
{"event":"forgot password"}
但是当我尝试反序列化时,我得到了
Caused by: org.codehaus.jackson.map.JsonMappingException: Can not construct instance of com.globalrelay.gas.appsjson.authportal.Event from String value 'forgot password': value not one of declared Enum instance names
我在这里想念什么?
肥皂起泡泡
阿晨1998
相关分类