Jackson - Deserialising JSON string - TypeReference vs TypeFactory.constructCollectionType

前端 未结 2 1288
無奈伤痛
無奈伤痛 2021-02-01 13:38

To deserialise JSON string to a list of class, different ways listed at StackOverflow question

Type 1 (docs link):

List someClassList =          


        
2条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-01 14:21

    One more way you can achieve this is by :

    List list = Arrays.asList(mapper.readValue(jsonString, SomeClass[].class));

提交回复
热议问题