com.sigopt.model.APIResource Maven / Gradle / Ivy
package com.sigopt.model;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public final class APIResource {
public static T constructFromJson(String json, Class klass) {
T instance;
try {
instance = klass.newInstance();
} catch (InstantiationException e) {
throw new RuntimeException(e);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
Type type = new TypeToken