public List<Set<MemberType>> values() { List<Set<String>> valueStr = setMapAdapter.values(mapName); return valueStr .stream() .map( s -> { return s.stream().map(stringToMemberFun).collect(Collectors.toSet()); }) .collect(Collectors.toList()); }
void buildInMem() { Collection<EntityType> data = dataSrcFun.apply(dataSrc); java.util.Map<String, Set<String>> setMap = data.stream() .collect( Collectors.groupingBy( e -> keyToStringFun.apply(keyGetFun.apply(e)), Collectors.mapping( e -> memberToStringFun.apply(memberGetFun.apply(e)), Collectors.toSet()))); setMapAdapter.putInMem(mapName, setMap); }
public void put(KeyType key, Set<MemberType> value) { setMapAdapter.put( mapName, keyToStringFun.apply(key), value.stream().map(memberToStringFun).collect(Collectors.toSet())); }
public Set<MemberType> get(KeyType key) { Set<String> keyStrSet = setMapAdapter.get(mapName, keyToStringFun.apply(key)); return keyStrSet.stream().map(stringToMemberFun).collect(Collectors.toSet()); }
public Set<KeyType> keySet() { Set<String> keyStr = setMapAdapter.keySet(mapName); return keyStr.stream().map(stringToKeyFun).collect(Collectors.toSet()); }