Map转Object,Object转 Map

Map转Object

import com.alibaba.fastjson.JSON;

Map<String, Object> boneAgeOrderMap=boneAgeOrderService.getOne(boneAgeOrder);
System.out.println("Map"+boneAgeOrderMap);

BoneAgeOrderLog boneAgeOrderLog=JSON.parseObject(JSON.toJSONString(boneAgeOrderMap), BoneAgeOrderLog.class);
System.out.println("Object"+boneAgeOrderLog);

Map<String, Object>转Object,Object转 Map<String, Object>

Object转Map

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;

BoneAgeOrderLog boneAgeOrderLog=new BoneAgeOrderLog();

{boneAgeOrderLog.put("key1", "value1");
boneAgeOrderLog.put("key2", "value2");}

Map<String, String> params = JSONObject.parseObject(obj.toJSONString(), new TypeReference<Map<String, String>>(){});

Map<String, Object>转Object,Object转 Map<String, Object>

上一篇:Mask RCNN 学习笔记


下一篇:MFC双缓冲和裁剪问题导致闪烁