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:com.okta.sdk.models.log.LogTransaction.java
/** * Constructor for LogTransaction/* w w w. ja v a 2s. co m*/ * @param type {@link String} * @param id {@link String} * @param detail {@link Map} */ @JsonCreator public LogTransaction(@JsonProperty("type") String type, @JsonProperty("id") String id, @JsonProperty("detail") Map<String, Object> detail) { this.type = type; this.id = id; if (detail != null) { this.detail = ImmutableMap.copyOf(detail); } else { this.detail = null; } }
From source file:com.facebook.presto.redis.RedisPlugin.java
@Override public synchronized void setOptionalConfig(Map<String, String> optionalConfig) { this.optionalConfig = ImmutableMap.copyOf(requireNonNull(optionalConfig, "optionalConfig is null")); }
From source file:com.brighttag.agathon.dao.zerg.ZergCassandraRingDao.java
@Inject public ZergCassandraRingDao(ZergConnector zergConnector, @Named(ZergDaoModule.ZERG_REGION_PROPERTY) String currentRegion, @Named(ZergDaoModule.ZERG_CASSANDRA_RING_SCOPES) Map<String, String> ringScopes) { this.zergConnector = zergConnector; this.currentRegion = currentRegion; this.ringScopes = ImmutableMap.copyOf(ringScopes); }
From source file:org.jclouds.packet.compute.options.PacketTemplateOptions.java
public PacketTemplateOptions features(Map<String, String> features) { this.features = ImmutableMap.copyOf(checkNotNull(features, "features cannot be null")); return this; }
From source file:net.derquinse.common.collect.RegularImmutableHierarchy.java
RegularImmutableHierarchy(ImmutableHierarchy.Builder<E> builder) { this.elements = ImmutableSet.copyOf(builder.getElements()); this.firstLevel = ImmutableList.copyOf(builder.getFirstLevel()); this.parents = ImmutableMap.copyOf(builder.getParents()); this.children = ImmutableListMultimap.copyOf(builder.getChildren()); // Incomplete integrity check checkArgument(elements.size() == firstLevel.size() + children.size(), "Inconsistent hierarchy."); }
From source file:co.cask.cdap.data.stream.service.upload.LengthBasedContentWriterFactory.java
public LengthBasedContentWriterFactory(StreamConfig streamConfig, ConcurrentStreamWriter streamWriter, Map<String, String> headers, long bufferThreshold) { this.streamConfig = streamConfig; this.streamWriter = streamWriter; this.headers = ImmutableMap.copyOf(headers); this.bufferThreshold = bufferThreshold; }
From source file:com.github.gv2011.util.icol.guava.IMapBuilder.java
@Override public IMap<K, V> build() { synchronized (map) { return new IMapWrapper<>(ImmutableMap.copyOf(map)); } }
From source file:com.codenvy.client.core.model.project.DefaultRunnersDescription.java
@JsonCreator public DefaultRunnersDescription(@JsonProperty("default") String defaultRunner, @JsonProperty("configs") Map<String, DefaultRunnerConfiguration> configurations) { this.defaultRunner = defaultRunner; this.configurations = ImmutableMap .copyOf(configurations == null ? new HashMap<String, RunnerConfiguration>() : configurations); }
From source file:org.hawkular.metrics.model.Tenant.java
public Tenant(String id, Map<MetricType<?>, Integer> retentionSettings) { checkArgument(id != null, "Tenant id is null"); this.id = id; this.retentionSettings = retentionSettings == null ? ImmutableMap.of() : ImmutableMap.copyOf(retentionSettings); }
From source file:org.xpect.ui.highlighting.XpectTokenDefProvider.java
public Map<Integer, String> getTokenDefMap() { if (map == null) { AntlrTokenDefProvider provider = new AntlrTokenDefProvider(); provider.setAntlrTokenFileProvider(this); map = ImmutableMap.copyOf(provider.getTokenDefMap()); }//from w w w . ja v a 2s . com return map; }