示例#1
0
文件: GroupReader.java 项目: nesi/hub
  private Observable<Thing<Group>> createGroups(
      Multimap<String, String> groups, Optional<String> groupMatcher) {

    if (groupMatcher.isPresent()) {
      return Observable.from(groups.keySet())
          .filter(groupName -> MatcherUtils.wildCardMatch(groupName, groupMatcher.get()))
          .map(groupName -> um.getAllGroups().get(groupName))
          // TODO make that work for non-project groups too
          .filter(group -> group != null)
          .map(group -> wrapGroup(group));
    } else {
      return Observable.from(groups.keySet())
          .map(groupName -> um.getAllGroups().get(groupName))
          // TODO make that work for non-project groups too
          .filter(group -> group != null)
          .map(group -> wrapGroup(group));
    }
  }
示例#2
0
文件: GroupReader.java 项目: nesi/hub
 @Override
 public Observable<? extends Thing<?>> findThingsMatchingTypeAndKey(String type, String key) {
   return Observable.from(um.getAllGroups().values())
       .filter(g -> MatcherUtils.wildCardMatch(g.getGroupName(), key))
       .map(g -> wrapGroup(g));
 }