List of usage examples for com.google.common.collect Maps newLinkedHashMap
public static <K, V> LinkedHashMap<K, V> newLinkedHashMap()
From source file:org.gradle.internal.composite.CompositeBuildSettingsLoader.java
private Collection<IncludedBuild> getIncludedBuilds(StartParameter startParameter, SettingsInternal settings) { Map<File, IncludedBuild> includedBuildMap = Maps.newLinkedHashMap(); includedBuildMap.putAll(settings.getIncludedBuilds()); for (File file : startParameter.getIncludedBuilds()) { IncludedBuildFactory includedBuildFactory = buildServices.get(IncludedBuildFactory.class); if (!includedBuildMap.containsKey(file)) { includedBuildMap.put(file, includedBuildFactory.createBuild(file)); }//from w ww.j av a 2 s.c om } return validateBuildNames(includedBuildMap.values(), settings); }
From source file:io.smartspaces.master.ui.internal.web.WebSupport.java
/** * Get a selection list of controller modes. * * @param messageSource/* w w w .ja v a2 s. com*/ * messages for translation * @param locale * locale for translation * * @return list of controller modes */ public static Map<String, String> getControllerModes(MessageSource messageSource, Locale locale) { Map<String, String> items = Maps.newLinkedHashMap(); for (SpaceControllerMode mode : SpaceControllerMode.values()) { items.put(mode.name(), messageSource.getMessage(mode.getDescription(), null, locale)); } return items; }
From source file:org.sosy_lab.cpachecker.core.algorithm.termination.lasso_analysis.construction.InOutVariablesCollector.java
public InOutVariablesCollector(FormulaManagerView pFormulaManagerView, SSAMap pInVariablesSsa, SSAMap pOutVariablesSsa, Set<String> pRelevantVariables, Map<Formula, Formula> pSubstitution) { formulaManagerView = pFormulaManagerView; outVariablesSsa = pOutVariablesSsa;//from w w w .ja v a2 s.com inVariablesSsa = pInVariablesSsa; relevantVariables = pRelevantVariables; substitution = pSubstitution; ufs = Maps.newLinkedHashMap(); }
From source file:brooklyn.event.basic.AttributeMap.java
public Map<String, Object> asMap() { Map<String, Object> result = Maps.newLinkedHashMap(); for (Map.Entry<Collection<String>, Object> entry : values.entrySet()) { String sensorName = Joiner.on('.').join(entry.getKey()); Object val = (isNull(entry.getValue())) ? null : entry.getValue(); result.put(sensorName, val); }//from ww w . ja v a 2s.c om return result; }
From source file:com.afterkraft.kraftrpg.api.util.DirectedGraph.java
/** * Creates a new directed graph. */ public DirectedGraph() { this.vertexes = Maps.newLinkedHashMap(); }
From source file:org.smartdeveloperhub.vocabulary.util.Vocabularies.java
static Vocabularies create(final Catalog catalog) { final Map<Namespace, Vocabulary.Builder> builders = Maps.newLinkedHashMap(); for (final String moduleId : catalog.modules()) { final Module module = catalog.get(moduleId); final Version version = Version.create(module); Vocabulary.Builder builder = builders.get(version.vocabulary()); if (builder == null) { builder = Vocabulary.create(version.vocabulary()); builders.put(version.vocabulary(), builder); }//www .j a v a2 s .co m builder.addVersion(version); } final ImmutableMap.Builder<Namespace, Vocabulary> vocabularies = ImmutableMap.builder(); final ImmutableMap.Builder<Namespace, Namespace> versionIndex = ImmutableMap.builder(); for (final Vocabulary.Builder vBuilder : builders.values()) { final Vocabulary vocabulary = vBuilder.build(); final Namespace namespace = vocabulary.namespace(); vocabularies.put(namespace, vocabulary); for (final Namespace version : vocabulary.versions()) { versionIndex.put(version, namespace); } } return new Vocabularies(vocabularies.build(), versionIndex.build()); }
From source file:brooklyn.entity.rebind.plane.dto.ManagementPlaneSyncRecordImpl.java
private ManagementPlaneSyncRecordImpl(Builder builder) { masterNodeId = builder.masterNodeId; managementNodes = Maps.newLinkedHashMap(); for (ManagementNodeSyncRecord node : builder.nodes.values()) { checkState(!managementNodes.containsKey(node.getNodeId()), "duplicate nodeId %s", node.getNodeId()); managementNodes.put(node.getNodeId(), node); }/* w w w. j ava 2 s. co m*/ }
From source file:org.gradle.plugins.ide.eclipse.model.AbstractClasspathEntry.java
public AbstractClasspathEntry(String path) { Preconditions.checkNotNull(path);//from w w w . j a v a 2 s . c o m this.path = normalizePath(path); this.exported = false; this.accessRules = Sets.newLinkedHashSet(); this.entryAttributes = Maps.newLinkedHashMap(); }
From source file:org.apache.brooklyn.test.EntityTestUtils.java
public static <T> T assertAttributeEventuallyNonNull(final Entity entity, final AttributeSensor<T> attribute) { return assertAttributeEventuallyNonNull(Maps.newLinkedHashMap(), entity, attribute); }
From source file:com.lithium.flow.config.PrefixConfig.java
@Override @Nonnull/*from w w w . j ava 2 s .c o m*/ public Map<String, String> asRawMap() { Map<String, String> rawMap = Maps.newLinkedHashMap(); Map<String, String> baseRawMap = delegate.asRawMap(); rawMap.putAll(baseRawMap); for (Map.Entry<String, String> configEntries : baseRawMap.entrySet()) { String key = configEntries.getKey(); String value = configEntries.getValue(); if (key.startsWith(prefix) && !key.equals(prefix)) { rawMap.put(key.substring(prefix.length()), value); } } return Collections.unmodifiableMap(rawMap); }