码迷,mamicode.com
首页 > 编程语言 > 详细

fastjson把map转成json字符串按字母大小排序

时间:2019-10-23 15:20:35      阅读:207      评论:0      收藏:0      [点我收藏+]

标签:serial   _id   user   field   type   shm   map   排序   string   

 public static void main(String[] args) {
        HashMap<String, Object> map=new HashMap<String, Object>();
        map.put("sign_status", "UNBIND");
        map.put("sign_type", "RSB");
        map.put("user_id", "2088622919786204");
        map.put("gmt_time", "20191023142225");
        System.out.println(JSON.toJSONString(map,SerializerFeature.MapSortField));
    }

 

fastjson把map转成json字符串按字母大小排序

标签:serial   _id   user   field   type   shm   map   排序   string   

原文地址:https://www.cnblogs.com/zyf-yxm/p/11726358.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!