TypeReference -- 让Jackson Json在List/Map中识别自己的Object
private Map<String, Object> buildHeaders(Object params) { ObjectMapper objectMapper = JacksonHelper.getMapper(); return objectMapper.convertValue(params, new TypeReference<Map<String, Object>>(){}); }
本文来自博客园,作者:hjzqyx,转载请注明原文链接:https://www.cnblogs.com/hujunzheng/p/8696556.html