public static <T> T getByMessageType(String jsonString, TypeReference<T> type) {
return JSON.parseObject(jsonString, type);
}
public static <T> T toBean(String text, Class<T> clazz) {
try {
return JSON.parseObject(text, clazz);
} catch (Exception e) {
log.error("JsonUtil | method=toBean() | Json 轉爲 Java Bean Error!" + e.getMessage(), e);
}
return null;
}