My target is is to convert jsonObject to Class. I want to add only fields that are anotated in Class. Example: json object holds 50 fields. Class has 4 fields. I want to map only exact 4 fields without adding 46 addition ignores in class.
JSON:
{
"id": "1",
"name": "John",
"Address": "Some Address 7009",
}
Class:
public static class User {
Integer id;
String name;
public User (@JsonProperty("id")Integer id, @JsonProperty("name")String name {
this.id= id;
this.name= name;
}
....
}
User class has no address field. My target is to exclude it, because it has no annotation.