Hi,
Rather updating all the properties, I want to update the values for only
null fields using readerForUpdating.
*Class:*
@Getter
@Setter
public class Record {
public String source;
public String resource;
}
Record record = new Record();
record.setSource("sourceFromObject");
record.setResource(null);
*Json:*
String json = {"source": "sourceFromJson", "resource":"resourceFromJson"}
When I do,
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.readerForUpdating(record).readValue(json);
am getting the result as [Record: source = " sourceFromJson ", resource =
"resourceFromJson" ] but
*I want the result to be [Record: source = "sourceFromObject", resource =
"resourceFromJson" ]*
Could anyone please help on this.
Regards,
Senthil
--
You received this message because you are subscribed to the Google Groups
"jackson-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jackson-user/a7cc274e-bab2-405a-bbcb-4afdfc011e29n%40googlegroups.com.