@Override public BiMap<UUID, String> getApplicationsForOrganizations( Set<UUID> organizationIds ) throws Exception { if ( organizationIds == null ) { return null; } BiMap<UUID, String> applications = HashBiMap.create(); for ( UUID organizationId : organizationIds ) { BiMap<UUID, String> organizationApplications = getApplicationsForOrganization( organizationId ); applications.putAll( organizationApplications ); } return applications; }
@Override protected BiMap<String, String> create(Entry<String, String>[] entries) { BiMap<String, String> map = HashBiMap.create(); putEntries(map, entries); map.putAll(ENTRIES_TO_FILTER); return Maps.filterKeys(map, FILTER_KEYS); } })
@Override protected BiMap<String, String> create(Entry<String, String>[] entries) { BiMap<String, String> map = HashBiMap.create(); putEntries(map, entries); map.putAll(ENTRIES_TO_FILTER); return Maps.filterValues(map, FILTER_VALUES); } })
@Override protected BiMap<String, String> create(Entry<String, String>[] entries) { BiMap<String, String> map = HashBiMap.create(); putEntries(map, entries); map.putAll(ENTRIES_TO_FILTER); return Maps.filterEntries(map, FILTER_ENTRIES); } })
public static BiMap<UUID, String> getOrganizations() { Subject currentUser = getSubject(); if ( !isOrganizationAdmin() ) { return null; } Session session = currentUser.getSession(); BiMap<UUID, String> organizations = HashBiMap.create(); Map map = (Map)session.getAttribute( "organizations" ); organizations.putAll(map); return organizations; }
@SuppressWarnings( "unchecked" ) public static BiMap<UUID, String> getApplications() { Subject currentUser = getSubject(); if ( currentUser == null ) { return null; } if ( !currentUser.hasRole( ROLE_APPLICATION_ADMIN ) && !currentUser.hasRole( ROLE_APPLICATION_USER ) ) { return null; } Session session = currentUser.getSession(); BiMap<UUID, String> applications = HashBiMap.create(); Map map = (Map)session.getAttribute( "applications" ); applications.putAll(map); return applications; }
unmod.putAll(Collections.singletonMap(4, "four")); fail("UnsupportedOperationException expected"); } catch (UnsupportedOperationException expected) { inverse.putAll(Collections.singletonMap("four", 4)); fail("UnsupportedOperationException expected"); } catch (UnsupportedOperationException expected) {
stringTable.putAll(StringTable.commonStrings(revision.major()));
public void setCategoryMap(final Map<String, ProjectCategoryPair> categoryMap) { this.categoryMap = HashBiMap.create(categoryMap.size()); this.categoryMap.putAll(categoryMap); }
public void loadClassCodes(Map<String, ClassCode> classCodes) { if (classCodes != null) { int i = 0; for (ClassCode classCode : classCodes.values()) { this.classNames.put(String.valueOf(i++), classCode.variableType.getDesc()); } this.classNames.putAll(VariableType.DESCRIPTORS); } }
@Inject public void initializeTokenDefsFrom(ITokenDefProvider provider) { tokenDefs.clear(); tokenDefs.putAll(provider.getTokenDefMap()); }
@Inject public void initializeTokenDefsFrom(ITokenDefProvider provider) { tokenDefs.clear(); tokenDefs.putAll(provider.getTokenDefMap()); }
@Override public void readFromNBT(@NotNull final NBTTagCompound compound) { recipes.putAll(NBTUtils.streamCompound(compound.getTagList(TAG_RECIPES, Constants.NBT.TAG_COMPOUND)) .map(recipeCompound -> (IRecipeStorage) StandardFactoryController.getInstance().deserialize(recipeCompound)) .collect(Collectors.toMap(IRecipeStorage::getToken, recipe -> recipe))); } }
@Override public void readFromNBT(@NotNull final NBTTagCompound compound) { super.readFromNBT(compound); fightingPos.clear(); final NBTTagList targetTagList = compound.getTagList(TAG_COMBAT_TARGET, Constants.NBT.TAG_COMPOUND); fightingPos.addAll(NBTUtils.streamCompound(targetTagList).map(targetCompound -> BlockPosUtil.readFromNBT(targetCompound, TAG_TARGET)).collect(Collectors.toList())); final NBTTagList partnersTagList = compound.getTagList(TAG_COMBAT_PARTNER, Constants.NBT.TAG_COMPOUND); trainingPartners.putAll(NBTUtils.streamCompound(partnersTagList).collect(Collectors.toMap(targetCompound -> targetCompound.getInteger(TAG_PARTNER1), targetCompound -> targetCompound.getInteger(TAG_PARTNER2)))); }
private BindingRuntimeContext(final ClassLoadingStrategy strategy, final SchemaContext schema) { this.strategy = strategy; this.schemaContext = schema; final BindingGeneratorImpl generator = new BindingGeneratorImpl(false); final Map<Module, ModuleContext> modules = generator.getModuleContexts(this.schemaContext); for (final ModuleContext ctx : modules.values()) { this.augmentationToSchemas.putAll(ctx.getTypeToAugmentations()); this.targetToAugmentation.putAll(ctx.getTargetToAugmentation()); this.typeToDefiningSchema.putAll(ctx.getTypeToSchema()); ctx.getTypedefs(); this.choiceToCases.putAll(ctx.getChoiceToCases()); this.identities.putAll(ctx.getIdentities()); } }
@Override protected BiMap<String, String> create(Entry<String, String>[] entries) { BiMap<String, String> map = HashBiMap.create(); putEntries(map, entries); map.putAll(ENTRIES_TO_FILTER); return Maps.filterKeys(map, FILTER_KEYS); } })
private BindingRuntimeContext(final ClassLoadingStrategy strategy, final SchemaContext schema) { this.strategy = strategy; this.schemaContext = schema; final BindingGeneratorImpl generator = new BindingGeneratorImpl(false); generator.generateTypes(schema); final Map<Module, ModuleContext> modules = generator.getModuleContexts(); for (final ModuleContext ctx : modules.values()) { augmentationToSchema.putAll(ctx.getTypeToAugmentation()); typeToDefiningSchema.putAll(ctx.getTypeToSchema()); ctx.getTypedefs(); augmentableToAugmentations.putAll(ctx.getAugmentableToAugmentations()); choiceToCases.putAll(ctx.getChoiceToCases()); identities.putAll(ctx.getIdentities()); } }
@Override protected BiMap<String, String> create(Entry<String, String>[] entries) { BiMap<String, String> map = HashBiMap.create(); putEntries(map, entries); map.putAll(ENTRIES_TO_FILTER); return Maps.filterEntries(map, FILTER_ENTRIES); } })
@Override protected BiMap<String, String> create(Entry<String, String>[] entries) { BiMap<String, String> map = HashBiMap.create(); putEntries(map, entries); map.putAll(ENTRIES_TO_FILTER); return Maps.filterValues(map, FILTER_VALUES); } })
public static StudyConfiguration stats(VariantStatisticsManager vsm, QueryOptions options, StudyConfiguration studyConfiguration, Map<String, Set<String>> cohorts, Map<String, Integer> cohortIds, VariantDBAdaptor dbAdaptor, URI resolve) throws IOException, StorageEngineException { if (vsm instanceof DefaultVariantStatisticsManager) { DefaultVariantStatisticsManager dvsm = (DefaultVariantStatisticsManager) vsm; URI stats = dvsm.createStats(dbAdaptor, resolve, cohorts, cohortIds, studyConfiguration, options); dvsm.loadStats(dbAdaptor, stats, studyConfiguration, options); } else { studyConfiguration.getCohortIds().putAll(cohortIds); cohorts.forEach((cohort, samples) -> { Set<Integer> sampleIds = samples.stream().map(studyConfiguration.getSampleIds()::get).collect(Collectors.toSet()); studyConfiguration.getCohorts().put(cohortIds.get(cohort), sampleIds); }); dbAdaptor.getStudyConfigurationManager().updateStudyConfiguration(studyConfiguration, null); vsm.calculateStatistics(studyConfiguration.getStudyName(), new ArrayList<>(cohorts.keySet()), options); } return dbAdaptor.getStudyConfigurationManager().getStudyConfiguration(studyConfiguration.getStudyId(), null).first(); }