I need to deserialize a JSON to a Java class with a Serializable
field.
In the following Java class the value
field is an interface, the idea is that the view can send values of types: String
, Double
, Long
and ArrayList
. If I change the type of value field from Serializable
to Object
, it works as expected.
public class UpdateAttribute implements Serializable {
//..
// There is something like: @JsonImplType(Object.class)
private Serializable value;
}
My question is, there is such a way to define a default class type to the value field? Something like: @JsonImplType(Object.class)
?