java 微服务间对象传输

使用ObjectMapper

 

字节转对象:

object = objectMapper.readValue(byte[], class.class)

 

Object转对象(直接强转报错):

object = objectMapper.convertValue(json, class.class)

posted @ 2021-08-04 11:33  wangssd  阅读(346)  评论(0编辑  收藏  举报