- public static String objectToJson(Object object)
- {
- String jsonStr=null;
- if (object != null)
- {
- jsonStr = gson.toJson(object);
- }
- return jsonStr;
- }
- //该片段来自于http://www.codesnippet.cn/detail/130920135877.html
来源: http://www.codesnippet.cn/detail/130920135877.html