package com.chinaztt.mes.common.util;
|
|
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.serializer.SerializerFeature;
|
|
|
/**
|
* @Author: zhangxy
|
* @Date: 2020-09-01 15:13
|
*/
|
public class JsonUtils {
|
|
public static JSONObject toJsonObject(Object obj) {
|
return JSON.parseObject(JSON.toJSONString(obj, SerializerFeature.WriteMapNullValue));
|
}
|
|
public static JSONArray toJsonArray(Object obj) {
|
return JSON.parseArray(JSON.toJSONString(obj, SerializerFeature.WriteMapNullValue));
|
}
|
}
|