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

com.github.dts.sdk.util.JsonUtil Maven / Gradle / Ivy

package com.github.dts.sdk.util;

import com.fasterxml.jackson.databind.ObjectMapper;

import java.io.IOException;

public class JsonUtil {
    private JsonUtil() {
    }

    public static ObjectReader objectReader() {
        ObjectMapper objectMapper = new ObjectMapper();
        return new ObjectReader() {
            @Override
            public  T readValue(String json, Class type) throws IOException {
                return objectMapper.readValue(json, type);
            }
        };
    }

    public interface ObjectReader {
         T readValue(String json, Class type) throws IOException;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy