INNER CODE UNIT · Java
toJson
SeaseLtd/rated-ranking-evaluator · rre-core/src/main/java/io/sease/rre/Func.java:76
public static JsonNode toJson(final File file) {
final ObjectMapper mapper = new ObjectMapper();
try {
return mapper.readTree(file);
} catch (final IOException exception) {
throw new IllegalArgumentException(file.getAbsolutePath(), exception);
}
}
/**
* Creates a new {@link Metric} instance.
*
* @param clazzName the metric class.
* @return a new {@link Metric} instance.
*/
@SuppressWarnings("unchecked")
public static Class<? extends Metric> newMetricDefinition(final String clazzName) {
try {