public static String getAsciiSort(Map<String, Object> map) {
List<Entry<String, Object>> infoIds = new ArrayList<Entry<String, Object>>(map.entrySet());
// 对所有传入参数按照字段名的 ASCII 码从小到大排序(字典序)
Collections.sort(infoIds, new Comparator<Entry<String, Object>>() {
public int compare(Map.Entry<String, Object> o1, Map.Entry<String, Object> o2) {
return ((String) o1.getKey()).compareToIgnoreCase((String) o2.getKey());
}
});
}

相关文章:

  • 2022-12-23
  • 2021-10-11
  • 2021-12-10
  • 2021-12-26
  • 2022-02-18
  • 2022-02-01
  • 2021-10-10
  • 2021-12-15
猜你喜欢
  • 2021-12-24
  • 2022-02-09
  • 2022-12-23
  • 2022-01-06
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案