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.elasticsearch.gateway.local.LocalGatewayStartedShards.java

public LocalGatewayStartedShards(long version, Map<ShardId, Long> shards) {
    this.version = version;
    this.shards = ImmutableMap.copyOf(shards);
}

From source file:com.netflix.spinnaker.clouddriver.core.limits.ServiceLimitConfiguration.java

public ServiceLimitConfiguration(ServiceLimits defaults, Map<String, ServiceLimits> cloudProviderOverrides,
        Map<String, ServiceLimits> accountOverrides, Map<String, ImplementationLimits> implementationLimits) {
    this.defaults = defaults == null ? new ServiceLimits(null) : defaults;
    this.cloudProviderOverrides = cloudProviderOverrides == null ? Collections.emptyMap()
            : ImmutableMap.copyOf(cloudProviderOverrides);
    this.accountOverrides = accountOverrides == null ? Collections.emptyMap()
            : ImmutableMap.copyOf(accountOverrides);
    this.implementationLimits = implementationLimits == null ? Collections.emptyMap()
            : ImmutableMap.copyOf(implementationLimits);
}

From source file:org.apache.twill.internal.DefaultTwillRunnableSpecification.java

public DefaultTwillRunnableSpecification(String className, TwillRunnableSpecification other) {
    this.className = className;
    this.name = other.getName();
    this.arguments = ImmutableMap.copyOf(other.getConfigs());
}

From source file:io.datakernel.serializer.GsonSubclassesAdapter.java

public GsonSubclassesAdapter(Map<String, Class<? extends T>> classTags,
        Map<String, InstanceCreator<T>> classCreators, String subclassField,
        Map<String, Class<? extends T>> subclassNames) {
    this.classTags = ImmutableBiMap.copyOf(classTags);
    this.classCreators = ImmutableMap.copyOf(classCreators);
    this.subclassField = subclassField;
    this.subclassNames = ImmutableBiMap.copyOf(subclassNames);
}

From source file:com.facebook.presto.hive.metastore.file.DatabaseMetadata.java

@JsonCreator
public DatabaseMetadata(@JsonProperty("ownerName") String ownerName,
        @JsonProperty("ownerType") PrincipalType ownerType, @JsonProperty("comment") Optional<String> comment,
        @JsonProperty("parameters") Map<String, String> parameters) {
    this.ownerName = requireNonNull(ownerName, "ownerName is null");
    this.ownerType = requireNonNull(ownerType, "ownerType is null");
    this.comment = requireNonNull(comment, "comment is null");
    this.parameters = ImmutableMap.copyOf(requireNonNull(parameters, "parameters is null"));
}

From source file:org.onosproject.yang.model.InnerModelObject.java

@Override
public Map<Class<? extends InnerModelObject>, InnerModelObject> augmentations() {
    return ImmutableMap.copyOf(augments);
}

From source file:com.facebook.presto.plugin.jdbc.JdbcConnectorFactory.java

public JdbcConnectorFactory(String name, Module module, Map<String, String> optionalConfig,
        ClassLoader classLoader) {
    checkArgument(!isNullOrEmpty(name), "name is null or empty");
    this.name = name;
    this.module = requireNonNull(module, "module is null");
    this.optionalConfig = ImmutableMap.copyOf(requireNonNull(optionalConfig, "optionalConfig is null"));
    this.classLoader = requireNonNull(classLoader, "classLoader is null");
}

From source file:eu.redzoo.reactive.kafka.rest.Environment.java

public ImmutableMap<String, String> getConfigValues(ImmutableSet<String> names) {
    return ImmutableMap.copyOf(Maps.filterKeys(configs, name -> names.contains(name)));
}

From source file:com.facebook.presto.verifier.Query.java

public Query(String catalog, String schema, List<String> preQueries, String query, List<String> postQueries,
        String username, String password, Map<String, String> sessionProperties) {
    this.catalog = catalog;
    this.schema = schema;
    this.preQueries = preQueries.stream().map(Query::clean).collect(toImmutableList());
    this.query = clean(query);
    this.postQueries = postQueries.stream().map(Query::clean).collect(toImmutableList());
    this.username = username;
    this.password = password;
    this.sessionProperties = ImmutableMap.copyOf(sessionProperties);
}