List of usage examples for com.google.common.collect ImmutableMap copyOf
public static <K, V> ImmutableMap<K, V> copyOf(Iterable<? extends Entry<? extends K, ? extends V>> entries)
From source file:org.hawkular.metrics.tasks.impl.Task2Impl.java
public Task2Impl(UUID id, String groupKey, int order, String name, Map<String, String> parameters, Trigger trigger) {/*from w w w. jav a 2 s . c o m*/ this.id = id; this.groupKey = groupKey; this.order = order; this.name = name; this.parameters = ImmutableMap.copyOf(parameters); this.trigger = trigger; }
From source file:org.gradle.language.nativeplatform.internal.incremental.BuildableCompilationState.java
public CompilationState snapshot() { return new CompilationState(ImmutableSet.copyOf(sourceInputs), ImmutableMap.copyOf(fileStates)); }
From source file:com.continuuity.weave.internal.DefaultWeaveRunnableSpecification.java
public DefaultWeaveRunnableSpecification(String className, WeaveRunnableSpecification other) { this.className = className; this.name = other.getName(); this.arguments = ImmutableMap.copyOf(other.getConfigs()); }
From source file:com.google.devtools.build.lib.rules.android.AndroidFeatureFlagSetProvider.java
/** Creates a new AndroidFeatureFlagSetProvider with the given flags. */ public static AndroidFeatureFlagSetProvider create(Map<Label, String> flags) { return new AutoValue_AndroidFeatureFlagSetProvider(ImmutableMap.copyOf(flags)); }
From source file:edu.bsu.storygame.core.model.Narrative.java
private Narrative(Builder builder) { this.map = ImmutableMap.copyOf(builder.map); }
From source file:io.prestosql.cost.StatsAndCosts.java
@JsonCreator public StatsAndCosts(@JsonProperty("stats") Map<PlanNodeId, PlanNodeStatsEstimate> stats, @JsonProperty("costs") Map<PlanNodeId, PlanNodeCostEstimate> costs) { this.stats = ImmutableMap.copyOf(requireNonNull(stats, "stats is null")); this.costs = ImmutableMap.copyOf(requireNonNull(costs, "costs is null")); }
From source file:com.google.devtools.build.lib.analysis.constraints.SupportedEnvironments.java
public SupportedEnvironments(EnvironmentCollection staticEnvironments, EnvironmentCollection refinedEnvironments, Map<Label, Target> removedEnvironmentCulprits) { this.staticEnvironments = staticEnvironments; this.refinedEnvironments = refinedEnvironments; this.removedEnvironmentCulprits = ImmutableMap.copyOf(removedEnvironmentCulprits); }
From source file:org.jclouds.docker.internal.NullSafeCopies.java
/** * Copies given Map with keeping null value if provided. * * @param map/*from w ww.j a v a2s. co m*/ * instance to copy (maybe <code>null</code>) * @return if the parameter is not-<code>null</code> then immutable copy; * <code>null</code> otherwise */ public static <K, V> Map<K, V> copyWithNullOf(@Nullable Map<K, V> map) { return map != null ? ImmutableMap.copyOf(map) : null; }
From source file:com.querydsl.core.types.QTuple.java
private static ImmutableMap<Expression<?>, Integer> createBindings(List<Expression<?>> exprs) { Map<Expression<?>, Integer> map = Maps.newHashMap(); for (int i = 0; i < exprs.size(); i++) { Expression<?> e = exprs.get(i); if (e instanceof Operation && ((Operation<?>) e).getOperator() == Ops.ALIAS) { map.put(((Operation<?>) e).getArg(1), i); }/*from w ww. ja va2s . c o m*/ map.put(e, i); } return ImmutableMap.copyOf(map); }
From source file:org.onosproject.models.tapi.TapiModelRegistrator.java
private static Map<YangModuleId, AppModuleInfo> getAppInfo() { Map<YangModuleId, AppModuleInfo> appInfo = new HashMap<>(); appInfo.put(new DefaultYangModuleId("tapi-connectivity", "2018-03-07"), new DefaultAppModuleInfo(TapiConnectivity.class, null)); appInfo.put(new DefaultYangModuleId("tapi-common", "2018-03-07"), new DefaultAppModuleInfo(TapiCommon.class, null)); appInfo.put(new DefaultYangModuleId("tapi-topology", "2018-03-07"), new DefaultAppModuleInfo(TapiTopology.class, null)); appInfo.put(new DefaultYangModuleId("tapi-path-computation", "2018-03-07"), new DefaultAppModuleInfo(TapiPathComputation.class, null)); return ImmutableMap.copyOf(appInfo); }