org.vfdtech.models.CoreBankingResponseSerializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of utilities-and-generic-tools Show documentation
Show all versions of utilities-and-generic-tools Show documentation
A utilities service with generic tools implementation. Can be
plugged into your java project
package org.vfdtech.models;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
import java.util.Objects;
public class CoreBankingResponseSerializer extends JsonDeserializer {
private static final ObjectMapper mapper = new ObjectMapper();
@Override
public CoreBankingResponse deserialize(JsonParser jsonParser, DeserializationContext deserializationContext)
throws IOException {
if (Objects.isNull(jsonParser)) {
return null;
}
return mapper.readValue(jsonParser.getText(), CoreBankingResponse.class);
}
}