Example usage for com.google.common.collect ImmutableMap copyOf

List of usage examples for com.google.common.collect ImmutableMap copyOf

Introduction

In this page you can find the example usage for com.google.common.collect ImmutableMap copyOf.

Prototype

public static <K, V> ImmutableMap<K, V> copyOf(Iterable<? extends Entry<? extends K, ? extends V>> entries) 

Source Link

Usage

From source file:org.onos.yangtools.yang.parser.builder.util.AbstractDocumentedDataNodeContainer.java

protected AbstractDocumentedDataNodeContainer(final AbstractDocumentedDataNodeContainerBuilder data) {
    super(data);//  w  w w.ja  v  a 2  s  .  c o m
    // FIXME : Should be unmodifiable ordered set (ordered by QName... or appearance in YANG file).
    // consider using new TreeSet<>(Comparators.SCHEMA_NODE_COMP);

    childNodes = ImmutableMap.copyOf(data.getChildNodes());
    groupings = ImmutableSet.copyOf(data.getGroupings());
    uses = ImmutableSet.copyOf(data.getUsesNodes());
    typeDefinitions = ImmutableSet.copyOf(data.getTypeDefinitions());
    publicChildNodes = ImmutableSet.copyOf(childNodes.values());
}

From source file:com.outerspacecat.util.ConcurrentNamespaceContext.java

private ConcurrentNamespaceContext(final ImmutableMap<String, String> prefixMap,
        final ImmutableMultimap<String, String> namespaceMap) {
    this.prefixMap = ImmutableMap.copyOf(prefixMap);
    this.namespaceMap = ImmutableMultimap.copyOf(namespaceMap);
}

From source file:co.cask.cdap.internal.service.http.DefaultHttpServiceSpecification.java

/**
 * Instantiate this class with the following parameters.
 *
 * @param className/*w w w.  j  a va 2 s. c  o  m*/
 * @param name
 * @param description
 * @param properties
 */
public DefaultHttpServiceSpecification(String className, String name, String description,
        Map<String, String> properties) {
    this.className = className;
    this.name = name;
    this.description = description;
    this.properties = ImmutableMap.copyOf(properties);
}

From source file:com.facebook.presto.elasticsearch.ElasticsearchConnectorFactory.java

public ElasticsearchConnectorFactory(Map<String, String> optionalConfig, ClassLoader classLoader) {
    this.optionalConfig = ImmutableMap.copyOf(requireNonNull(optionalConfig, "optionalConfig is null"));
    this.classLoader = requireNonNull(classLoader, "classLoader is null");
}

From source file:org.artifactory.spring.SpringConfigPaths.java

public SpringConfigPaths(List<String> paths, Map<String, AddonInfo> installedAddonPaths) {
    this.paths = ImmutableList.copyOf(paths);
    this.installedAddonPaths = ImmutableMap.copyOf(installedAddonPaths);
}

From source file:org.opendaylight.ocpjava.protocol.impl.deserialization.DeserializationFactory.java

/**
 * Constructor/*  w  w  w .  j ava2  s.  co  m*/
 */
public DeserializationFactory() {
    final Map<TypeToClassKey, Class<?>> temp = new HashMap<>();
    TypeToClassMapInitializer.initializeTypeToClassMap(temp);
    messageClassMap = ImmutableMap.copyOf(temp);
    LOG.trace("DeserializationFactory: messageClassMap = {}", messageClassMap);
}

From source file:de.flapdoodle.logparser.LogEntry.java

public LogEntry(List<String> source, Map<String, String> attributes, Optional<StackTrace> stackTrace,
        List<String> messages) {
    _source = ImmutableList.copyOf(source);
    _attributes = ImmutableMap.copyOf(attributes);
    _stackTrace = stackTrace;// w  w  w .j  a va 2 s  .c o  m
    _messages = ImmutableList.copyOf(messages);
}

From source file:com.jeroensteenbeeke.andalite.forge.AbstractForgeRecipe.java

protected AbstractForgeRecipe(String name, Map<String, String> extraSettings) {
    super();/*from   w  w w.ja v a2 s. c o m*/
    this.extraSettings = ImmutableMap.copyOf(extraSettings);
    this.identifier = name;
}

From source file:com.opengamma.engine.marketdata.manipulator.ScenarioDefinition.java

public ScenarioDefinition(String name, Map<DistinctMarketDataSelector, FunctionParameters> definitionMap) {
    ArgumentChecker.notEmpty(name, "name");
    _name = name;/*from   w w w  .  ja  v a 2s .  c o  m*/
    _definitionMap = ImmutableMap.copyOf(definitionMap);
}

From source file:com.facebook.presto.sql.planner.plan.ProjectNode.java

@JsonCreator
public ProjectNode(@JsonProperty("id") PlanNodeId id, @JsonProperty("source") PlanNode source,
        @JsonProperty("assignments") Map<Symbol, Expression> assignments) {
    super(id);//from ww  w .j a  v  a  2s . c o m

    this.source = source;
    this.assignments = ImmutableMap.copyOf(assignments);
    this.outputs = ImmutableList.copyOf(assignments.keySet());
}