Explorar el Código

更新 '_posts/常用代码块.md'

aaronwei hace 4 años
padre
commit
70119e05b5
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      _posts/常用代码块.md

+ 3 - 0
_posts/常用代码块.md

@@ -52,6 +52,9 @@ private static Map<String, Object> sortByKey(Map<String, Object> map) {
     //2 按照多个字段
     Map<String, List<Object>> groupBy = objectList.stream().collect(Collectors
     .groupingBy(o -> o.getAttr1() + "_" + o.getAttr2()));
+    
+    Set<Long> attrs = list.stream().map(Object::getAttr).collect(Collectors.toSet());
+
 
 ```