package org.stagemonitor.core.configuration.converter;

import java.io.IOException;

import com.fasterxml.jackson.core.type.TypeReference;
import org.stagemonitor.core.util.JsonUtils;

public class JsonValueConverter<T> implements ValueConverter<T> {

	private final TypeReference<T> typeReference;

	public JsonValueConverter(TypeReference<T> typeReference) {
		this.typeReference = typeReference;
	}

	@Override
	public T convert(String s) {
		try {
			return JsonUtils.getMapper().readValue(s, typeReference);
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
	}

	@Override
	public String toString(T value) {
		return JsonUtils.toJson(value);
	}
}

@@ -53,37 +53,8 @@
 r;%0A%0A
-import java.io.IOException;%0A%0A
 impo
@@ -103,16 +103,17 @@
 erence;%0A
+%0A
 import o
@@ -150,16 +150,45 @@
 Utils;%0A%0A
+import java.io.IOException;%0A%0A
 public c
@@ -552,15 +552,23 @@
 new 
-Runtime
+IllegalArgument
 Exce

Fix JsonValueConverter