DBZ-7887 added additional JsonSerde constructor

This commit is contained in:
Mark Banierink 2024-05-21 21:49:01 +02:00 committed by Jiri Pechanec
parent 117725ab54
commit 4bc98c6661

View File

@ -42,7 +42,11 @@ public class JsonSerde<T> implements Serde<T> {
private JsonSerdeConfig config;
public JsonSerde(Class<T> objectType) {
mapper = new ObjectMapper();
this(objectType, new ObjectMapper());
}
public JsonSerde(Class<T> objectType, ObjectMapper mapper) {
this.mapper = mapper;
mapper.registerModule(new JavaTimeModule());
this.reader = mapper.readerFor(objectType);