All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.kestra.plugin.debezium.CustomParameterDeserializer Maven / Gradle / Ivy

The newest version!
package io.kestra.plugin.debezium;

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.Map;

public class CustomParameterDeserializer extends JsonDeserializer> {
    private final ObjectMapper mapper = new ObjectMapper();

    @Override
    public Map deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
        if (ctxt.getParser().currentToken().name().equalsIgnoreCase("value_string")) {
            return mapper.readValue(p.getText(), Map.class);
        }
        return mapper.readValue(p, Map.class);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy