@Test void toJsonTest() { TemplateDefinition t1 = new TemplateDefinition(); t1.setId("Test template").setDescription("This is a test.").setFilenamePattern("Contract"); assertEquals("{\"refId\":1,\"variableDefinitions\":[],\"dependentVariableDefinitions\":[],\"id\":\"Test template\",\"description\":\"This is a test.\",\"filenamePattern\":\"Contract\",\"stronglyRestrictedFilenames\":true,\"autoGenerated\":false}", JsonUtils.toJson(t1)); t1.add(createVar("Name", true, true)); t1.add(createVar("Gender", true, false)); String json = JsonUtils.toJson(t1); TemplateDefinition t2 = JsonUtils.fromJson(TemplateDefinition.class, json); assertTemp(t1, t2); }
public static String toJson(Object obj) { return toJson(obj, false); }
JsonUtils { public static String toJson(Object obj) { return toJson(obj, false); } }
JsonUtils { public static String toJson(Object obj) { return toJson(obj, false); }  }
JsonUtils { public static String toJson(Object obj) { return toJson(obj, false); }  static String toJson(Object obj); static String toJson(Object obj, boolean prettyPrinter); static String toJson(String str); static T fromJson(Class<T> clazz, String json); static T fromJson(final TypeReference<T> type, final String json); }
JsonUtils { public static String toJson(Object obj) { return toJson(obj, false); }  static String toJson(Object obj); static String toJson(Object obj, boolean prettyPrinter); static String toJson(String str); static T fromJson(Class<T> clazz, String json); static T fromJson(final TypeReference<T> type, final String json);  }