18 package org.turro.contacts.social;
20 import java.util.ArrayList;
21 import java.util.List;
23 import java.util.stream.Collectors;
24 import org.turro.security.SecurityGroupType;
25 import org.zkoss.zul.SimpleGroupsModel;
31 public class SocialGroupModel extends SimpleGroupsModel<SocialGroupValue, String, Object, SocialGroupValue> {
34 super(collect(socials));
37 private static List<List<SocialGroupValue>> collect(List<SocialGroupValue> socials) {
38 Map<SecurityGroupType, List<SocialGroupValue>> map = socials.stream().sorted().collect(Collectors.groupingBy(sgv -> sgv.getType()));
39 List<List<SocialGroupValue>> list =
new ArrayList<>();
41 if(map.containsKey(type)) {
42 list.add(map.get(type));