问题
alibaba的fastjson怎么将json字符串转换为范型对象?
java
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.alibaba.fastjson2.TypeReference;
public static void main(String[] args) {
String jsonStr = "{}";
ResResult<OrionStarRobotItemLineOutVo> resResult = JSON.parseObject(jsonStr, new TypeReference<ResResult<OrionStarRobotItemLineOutVo>>() {});
}
将对象换成所需要的对象就OK了~