contentList.stream().collect(Collectors.toMap(ContentVO::getFieldCode, ContentVO::getFieldValue))

getFieldValuenull时,会抛出异常;需要换一种方法处理,能保存null值:

contentList.stream()
                .collect(HashMap::new, (map, item) -> map.put(item.getFieldCode(), item.getFieldValue()), HashMap::putAll);