@Test(expected = RuntimeException.class) public void testToObjectError() { JSONUtil.toObject("{int:1}", JSONObject.class); }
public static <T> T toObject(String json, Class<T> clazz) { T object; try { object = mapper.readValue(json, clazz); } catch (Exception e) { LOGGER.error("JSON String Can't covert to Java Object!"); throw new RuntimeException(e); } return object; }
JSONUtil { public static <T> T toObject(String json, Class<T> clazz) { T object; try { object = mapper.readValue(json, clazz); } catch (Exception e) { LOGGER.error("JSON String Can't covert to Java Object!"); throw new RuntimeException(e); } return object; } }
JSONUtil { public static <T> T toObject(String json, Class<T> clazz) { T object; try { object = mapper.readValue(json, clazz); } catch (Exception e) { LOGGER.error("JSON String Can't covert to Java Object!"); throw new RuntimeException(e); } return object; }  }
JSONUtil { public static <T> T toObject(String json, Class<T> clazz) { T object; try { object = mapper.readValue(json, clazz); } catch (Exception e) { LOGGER.error("JSON String Can't covert to Java Object!"); throw new RuntimeException(e); } return object; }  static String toJSONString(T object); static T toObject(String json, Class<T> clazz); }
JSONUtil { public static <T> T toObject(String json, Class<T> clazz) { T object; try { object = mapper.readValue(json, clazz); } catch (Exception e) { LOGGER.error("JSON String Can't covert to Java Object!"); throw new RuntimeException(e); } return object; }  static String toJSONString(T object); static T toObject(String json, Class<T> clazz);  }