io.deephaven.ssl.config.Parser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of deephaven-ssl-config Show documentation
Show all versions of deephaven-ssl-config Show documentation
The Deephaven SSL Configuration
The newest version!
//
// Copyright (c) 2016-2024 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);
}
}