Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * jackson deserialization json to generic java object
- *
- * @param jsonStr json string
- * @param typeReference typeReference
- * @return generic object
- * @author yanganyu
- * @date 2019/2/21 13:37
- */
- public static <T> T parse(String jsonStr, TypeReference<T> typeReference) {
- T result = null;
- try {
- result = new ObjectMapper().readValue(jsonStr, typeReference);
- } catch (IOException e) {
- e.printStackTrace();
- }
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement