ObjectMapper objectMapper = new ObjectMapper();String str = objectMapper.writeValueAsString(javaObj);
JavaType valueType = objectMapper.getTypeFactory().constructParametricType(HashMap.class, String.class, Object.class);HashMap<String, Object> map = objectMapper.readValue(str, valueType);
JavaType valueType = objectMapper.getTypeFactory().constructParametricType(ArrayList.class, Person.class);List<Person> list = objectMapper.readValue(str, valueType);