is it possible to deserialize enums, which have a one based index?
enum Status {
Active,
Inactive
}
{status:1} means Status.Active, but Jac
public enum Status {
ACTIVE(1),
INACTIVE(2);
private final int value;
Status(int v) {
value = v;
}
@org.codehaus.jackson.annotate.JsonValue
public int value() {
return value;
}
@org.codehaus.jackson.annotate.JsonCreator
public static Status fromValue(int typeCode) {
for (Status c: Status.values()) {
if (c.value==typeCode) {
return c;
}
}
throw new IllegalArgumentException("Invalid Status type code: " + typeCode);
}}