Map轉Objectjson
import com.alibaba.fastjson.JSON;spa
Map<String, Object> boneAgeOrderMap=boneAgeOrderService.getOne(boneAgeOrder);
System.out.println("Map"+boneAgeOrderMap);blog
BoneAgeOrderLog boneAgeOrderLog=JSON.parseObject(JSON.toJSONString(boneAgeOrderMap), BoneAgeOrderLog.class);
System.out.println("Object"+boneAgeOrderLog);get
Object轉Mapast
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;class
BoneAgeOrderLog boneAgeOrderLog=new BoneAgeOrderLog();import
{boneAgeOrderLog.put("key1", "value1");
boneAgeOrderLog.put("key2", "value2");}
im
Map<String, String> params = JSONObject.parseObject(obj.toJSONString(), new TypeReference<Map<String, String>>(){});img