blockTrips.asMap().values().forEach(unsortedTrips -> { List<TripWithStopTimes> trips = unsortedTrips.stream() .map(trip -> {
final Set<Operator<?>> visitedOperators = new HashSet<>(); for (Entry<Operator<?>, Collection<Operator<?>>> e : optimizerCache.operatorToWorkOperators.asMap().entrySet()) { if (visitedOperators.contains(e.getKey())) {
/** * @return A {@link Map} of default java package names that the extension should export and indicates which * are the classes that makes the package to be exported. */ public Map<String, Collection<String>> getDetailedExportedPackages() { collectDefault(); collectManuallyExportedPackages(); HashMultimap<String, String> exportedPackages = HashMultimap.create(); exportedClasses.stream() .map(clazz -> new Pair<>(packageFinder.packageFor(clazz).orElse(""), clazz)) .filter(pair -> !isBlank(pair.getFirst())) .filter(pair -> filteredPackages.stream().noneMatch(filteredPackage -> pair.getFirst().startsWith(filteredPackage))) .forEach(pair -> exportedPackages.put(pair.getFirst(), pair.getSecond())); return exportedPackages.asMap(); }
@Override public Map<String, Set<ActorRef>> getSubscribers() { if(messageSubscribers == null || messageSubscribers.isEmpty()) { return Collections.emptyMap(); } else { Map<String, Set<ActorRef>> result = new HashMap<>(); messageSubscribers.asMap().forEach((message, subscribers) -> { Set<ActorRef> subscriberSet = new HashSet<>(); subscribers.forEach(subscriber -> subscriberSet.add(subscriber.getSubscriberRef())); result.put(message, subscriberSet); } ); return result; } }
private Map<Domain, Collection<MailAddress>> groupByServer(Collection<MailAddress> recipients) { // Must first organize the recipients into distinct servers (name made case insensitive) HashMultimap<Domain, MailAddress> groupByServerMultimap = HashMultimap.create(); for (MailAddress recipient : recipients) { groupByServerMultimap.put(recipient.getDomain(), recipient); } return groupByServerMultimap.asMap(); }
public String toString() { return columnMappings.asMap() .entrySet() .stream() .map(entry -> entry.getValue() .stream() .map(colDef -> colDef.name.toString()) .collect(Collectors.joining(", ", entry.getKey().name.toString() + ":[", "]"))) .collect(Collectors.joining(", ", columnSpecifications.stream() .map(colSpec -> colSpec.name.toString()) .collect(Collectors.joining(", ", "{ Columns:[", "], Mappings:{")), "} }")); } }
public String toString() { return columnMappings.asMap() .entrySet() .stream() .map(entry -> entry.getValue() .stream() .map(colDef -> colDef.name.toString()) .collect(Collectors.joining(", ", entry.getKey().name.toString() + ":[", "]"))) .collect(Collectors.joining(", ", columnSpecifications.stream() .map(colSpec -> colSpec.name.toString()) .collect(Collectors.joining(", ", "{ Columns:[", "], Mappings:{")), "} }")); } }
protected Map<String, Collection<InternetAddress>> groupByDomain(Collection<InternetAddress> recipients) { final HashMultimap<String, InternetAddress> groupByServerMultimap = HashMultimap.create(); for (InternetAddress recipient : recipients) { final NHINDAddress addr = new NHINDAddress(recipient); groupByServerMultimap.put(addr.getHost(), recipient); } return groupByServerMultimap.asMap(); } }
/** * @return A {@link Map} of default java package names that the extension should export and indicates which * are the classes that makes the package to be exported. */ public Map<String, Collection<String>> getDetailedExportedPackages() { collectDefault(); collectManuallyExportedPackages(); HashMultimap<String, String> exportedPackages = HashMultimap.create(); exportedClasses.stream() .map(clazz -> new Pair<>(packageFinder.packageFor(clazz).orElse(""), clazz)) .filter(pair -> !isBlank(pair.getFirst())) .filter(pair -> filteredPackages.stream().noneMatch(filteredPackage -> pair.getFirst().startsWith(filteredPackage))) .forEach(pair -> exportedPackages.put(pair.getFirst(), pair.getSecond())); return exportedPackages.asMap(); }
/** * <p>Produces a relation between {@link com.atlassian.jira.application.ApplicationRole}s and {@link com.atlassian.jira.user.ApplicationUser}s * indicating which users will gain access to which applications if they will be added to given groups.</p> * <p>This method is useful only in seating counting. There is one gotcha: if users are already (or eventually will be) added to some * application, and we want to give them CORE access it's dry-run. We won't count them as jira-core users as it will be implied.</p> * @param users users to be checked * @param groupsToBeAdded groups to be added * @return users grouped by applications in which number of occupied seats should be incremented */ public Map<ApplicationRole, Set<ApplicationUser>> rolesToBeAddedForSeatingCountPurpose(Set<ApplicationUser> users, Set<String> groupsToBeAdded) { final SetMultimap<ApplicationUser, ApplicationRole> userToRoles = HashMultimap.create(); for (ApplicationUser user : users) { userToRoles.putAll(user, calculateRolesToBeAdded(user, groupsToBeAdded)); } return ImmutableMaps.transformValue( Multimaps.invertFrom(userToRoles, HashMultimap.create()).asMap(), ImmutableSet::copyOf ); }
Path i18nUserTranslationsDirectory = project.getI18nUserTranslationsDirectory(); for (Map.Entry<Locale, Collection<Pair<String, String>>> entry : translations.asMap().entrySet()) { Locale locale = entry.getKey(); I18nLanguage language = languageProvider.getLanguage(locale);
for (Map.Entry<MetaClass, Collection<Object>> entry : entitiesIdsToBeLoaded.asMap().entrySet()) { Map<Object, BaseGenericIdEntity> idToEntityMap = new HashMap<>(); MetaClass metaClass = entry.getKey();
Map<String, Collection<String>> stringCollectionMap = boundLogicalRoleNames.asMap(); for ( Entry<String, Collection<String>> stringCollectionEntry : stringCollectionMap.entrySet() ) { cacheManager.putInRegionCache( LOGICAL_ROLE_BINDINGS_REGION, stringCollectionEntry.getKey(),
@Override public void processEndDocument() { long unlinkedNumber = unlinkedElementsMap.size(); if (unlinkedNumber > 0) { NeoLogger.warn("Some elements have not been linked ({0})", unlinkedNumber); for (String e : unlinkedElementsMap.asMap().keySet()) { NeoLogger.warn(" > " + e); } unlinkedElementsMap.clear(); } long conflictedId = conflictElementIdCache.estimatedSize(); if (conflictedId > 0) { NeoLogger.info("{0} key conflicts", conflictElementIdCache.estimatedSize()); conflictElementIdCache.invalidateAll(); } backend.save(); }