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

ru.yandex.clickhouse.Jackson Maven / Gradle / Ivy

There is a newer version: 1.13.0
Show newest version
package ru.yandex.clickhouse;

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;

public class Jackson {

    private static final ThreadLocal om = new ThreadLocal() {
        @Override
        protected ObjectMapper initialValue() {
            ObjectMapper objectMapper = new ObjectMapper();
            objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
            return objectMapper;
        }
    };

    /**
     * Flyweight thread local objectMapper.  Users of this should not keep a reference to this.
     * @return an ObjectMapper
     */
    public static ObjectMapper getObjectMapper() {
        return om.get();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy