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

io.deephaven.ssl.config.Parser Maven / Gradle / Ivy

There is a newer version: 0.36.1
Show newest version
/**
 * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending
 */
package io.deephaven.ssl.config;

import com.fasterxml.jackson.databind.ObjectMapper;

import java.io.File;
import java.io.IOException;
import java.net.URL;

public class Parser {
    private static final ObjectMapper OBJECT_MAPPER;

    static {
        OBJECT_MAPPER = new ObjectMapper();
        OBJECT_MAPPER.findAndRegisterModules();
    }

    public static  T parseJson(File file, Class clazz) throws IOException {
        return OBJECT_MAPPER.readValue(file, clazz);
    }

    public static  T parseJson(String value, Class clazz) throws IOException {
        return OBJECT_MAPPER.readValue(value, clazz);
    }

    public static  T parseJson(URL url, Class clazz) throws IOException {
        return OBJECT_MAPPER.readValue(url, clazz);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy