I have an object like this to deserialize:
public class RelationsInput {
Relation relation1;
Relation relation2;
}
whereas the class Relation looks like this:
public class Relation {
RelationType relationtype;
... (more fields)
}
RelationType is en enum and is not a value which will be deserialized, while all others are.
Is it possible, that I could "inject" the enum value for the field relationType with an annotation on the field in the class RelationInput?
Like the following
public class RelationsInput {
@RelationType(RelationType.OWNER)
Relation owner;
@RelationType(RelationType.TENANT)
Relation tenant;
}
Does Jackson provide something like this?