我已经使用对象Map器将hashmap转换为byte[]。就像下面一样
private static final ObjectMapper objectMapper = new ObjectMapper()
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
.registerModule(new JavaTimeModule());
Map<String, String> entries = new HashMap<>();
entries.put("triggerId","123");
entries.put("webhookId","456");
byte[] message=objectMapper.writeValueAsBytes(entries)
现在我想把它转换回hashmap。我该怎么做?
2条答案
按热度按时间uqxowvwt1#
必须使用jackson对象Map器读取值。就像下面一样
gorkyyrv2#
我认为这是不可能的