Initial Question
Is it possible to have multiple @JsonCreator
methods, and for jackson to detect which one it should use depending on the method definiton?
@JsonCreator
public static StateOfComm factory(String id) {
return StateOfComm.valueOf(id);
}
@JsonCreator
public static StateOfComm factory(CustomType value) {
return StateOfComm.valueOf(value.getId());
}
Update
The JSON that fails (because id=null), is the following:
{"comment":null, "processes":[{"stateOfComm":{"id":"CA"}}]}
The following works:
{"comment":null, "processes":[{"stateOfComm":"CA"}]}