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:net.derquinse.common.collect.ImmutableHierarchyMap.java

/**
 * Returns an immutable hierarchy map backed by a map and a hierarchy.
 * @param map Backing map./*from w w  w .  ja  va2s. c  o m*/
 * @param hierarchy Backing hierachy.
 */
public static <K, V> ImmutableHierarchyMap<K, V> of(Map<? extends K, ? extends V> map,
        Hierarchy<? extends K> hierarchy) {
    check(map, hierarchy);
    if (map.isEmpty()) {
        return of();
    }
    return new RegularImmutableHierarchyMap<K, V>(ImmutableMap.copyOf(map),
            ImmutableHierarchy.copyOf(hierarchy));
}

From source file:com.continuuity.weave.api.AbstractWeaveRunnable.java

protected AbstractWeaveRunnable(Map<String, String> args) {
    this.args = ImmutableMap.copyOf(args);
}

From source file:uk.ac.ed.inf.ace.ReadableDocument.java

public ReadableDocument(String id, Object content, Map<String, Object> properties) {
    this.id = id;
    this.content = content;
    this.properties = ImmutableMap.copyOf(properties);
}

From source file:com.facebook.presto.mysql.MySQLPlugin.java

@Override
public void setOptionalConfig(Map<String, String> optionalConfig) {
    this.optionalConfig = ImmutableMap.copyOf(checkNotNull(optionalConfig, "optionalConfig is null"));
}

From source file:com.icosilune.fn.nodes.AbstractNode.java

public Map<String, Connection> getInputConnections() {
    return ImmutableMap.copyOf(inputConnections);
}

From source file:de.uniulm.omi.cloudiator.visor.monitoring.BaseMonitorContext.java

BaseMonitorContext(Map<String, String> context) {
    this.context = ImmutableMap.copyOf(context);
}

From source file:org.gradle.caching.internal.tasks.statistics.TaskExecutionStatistics.java

public TaskExecutionStatistics(Map<TaskExecutionOutcome, Integer> taskCounts, int cacheMissCount) {
    this.taskCounts = ImmutableMap.copyOf(taskCounts);
    int allTasksCount = 0;
    for (Integer taskCount : taskCounts.values()) {
        allTasksCount += taskCount;/* www .j a v  a  2s.co  m*/
    }
    this.allTasksCount = allTasksCount;
    this.cacheMissCount = cacheMissCount;
}

From source file:io.prestosql.tests.statistics.StatsContext.java

public StatsContext(Map<String, Symbol> columnSymbols, TypeProvider types) {
    this.columnSymbols = ImmutableMap.copyOf(columnSymbols);
    this.types = requireNonNull(types, "symbolTypes is null");
}

From source file:keywhiz.api.model.SanitizedSecret.java

@JsonCreator
public static SanitizedSecret of(@JsonProperty("id") long id, @JsonProperty("name") String name,
        @JsonProperty("description") @Nullable String description, @JsonProperty("checksum") String checksum,
        @JsonProperty("createdAt") ApiDate createdAt, @JsonProperty("createdBy") @Nullable String createdBy,
        @JsonProperty("updatedAt") ApiDate updatedAt, @JsonProperty("updatedBy") @Nullable String updatedBy,
        @JsonProperty("metadata") @Nullable Map<String, String> metadata,
        @JsonProperty("type") @Nullable String type,
        @JsonProperty("generationOptions") @Nullable Map<String, String> generationOptions,
        @JsonProperty("expiry") long expiry, @JsonProperty("version") @Nullable Long version) {
    ImmutableMap<String, String> meta = (metadata == null) ? ImmutableMap.of() : ImmutableMap.copyOf(metadata);
    ImmutableMap<String, String> genOptions = (generationOptions == null) ? ImmutableMap.of()
            : ImmutableMap.copyOf(generationOptions);
    return new AutoValue_SanitizedSecret(id, name, nullToEmpty(description), checksum, createdAt,
            nullToEmpty(createdBy), updatedAt, nullToEmpty(updatedBy), meta, Optional.ofNullable(type),
            genOptions, expiry, Optional.ofNullable(version));
}

From source file:io.prestosql.plugin.tpcds.statistics.TableStatisticsData.java

@JsonCreator
public TableStatisticsData(@JsonProperty("rowCount") long rowCount,
        @JsonProperty("columns") Map<String, ColumnStatisticsData> columns) {
    this.rowCount = rowCount;
    this.columns = ImmutableMap.copyOf(columns);
}