I have a scnario, where one of the property in my POJO is int and In JSON response I will get int type and sometimes I will get String type for the same property.
public class Foo {
private int id = -1;
public void setId(int _id){ this.id = _id; }
public int getId(){ return this.id; }
}
{
"id": "blah"
}
In This case I don't want to de-serialize.
I want to Ignore de-serialization If I get String type for the Property, Is there anyway to do that?
Note: I don't want to use String and Object type for the property and later handle in the code