stream根据map中的一个字段排序

Posted sikuaiwu

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了stream根据map中的一个字段排序相关的知识,希望对你有一定的参考价值。

org = org.stream().sorted(Comparator.comparing(SynchronousDataService::sort2)).collect(Collectors.toList());// 排序

private static String sort2(Map<String, Object> a)
  return (String) a.get("uri");
 

以上是关于stream根据map中的一个字段排序的主要内容,如果未能解决你的问题,请参考以下文章