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.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.ConvertReactor.java
protected ConvertReactor() { final Map<Short, ConvertReactorConvertor<FROM, ?>> conversions = new HashMap<>(); final Map<ConvertorKey, ResultInjector<?, ?>> injections = new HashMap<>(); initMappings(conversions, injections); // Create optimized view of mappings this.conversionMapping = ImmutableMap.copyOf(conversions); this.injectionMapping = ImmutableMap.copyOf(injections); }
From source file:org.ubiquity.mirror.Annotation.java
public Annotation(Class<?> annotationClass, boolean visible, java.util.Map<String, AnnotationProperty> properties) { this.annotationClass = annotationClass; this.visible = visible; this.properties = ImmutableMap.copyOf(properties); this.hash = Objects.hashCode(annotationClass, visible, this.properties); }
From source file:com.facebook.buck.rules.coercer.MapConcatenatingCoercer.java
@Override public Object concat(Iterable<Object> elements) { @SuppressWarnings("unchecked") Iterable<Set<Entry<Object, Object>>> maps = Iterables.transform(elements, map -> ((Map<Object, Object>) map).entrySet()); return ImmutableMap.copyOf(Iterables.concat(maps)); }
From source file:toughasnails.api.temperature.TemperatureHelper.java
/** * Get the current map of registered temperature modifiers. * * @return An immutable map of temperature modifiers *///from w ww . ja v a2 s. co m public static ImmutableMap<String, ITemperatureModifier> getTemperatureModifiers() { return ImmutableMap.copyOf(modifiers); }
From source file:com.dampcake.gson.immutable.ImmutableMapAdapter.java
/** * @see DelegateAdapter#transform(Object) */ @Override protected Map<?, ?> transform(Map<?, ?> map) { return ImmutableMap.copyOf(map); }
From source file:com.facebook.presto.sql.planner.NodePartitionMap.java
public NodePartitionMap(Map<Integer, Node> partitionToNode, ToIntFunction<Split> splitToBucket) { this.partitionToNode = ImmutableMap.copyOf(requireNonNull(partitionToNode, "partitionToNode is null")); this.bucketToPartition = IntStream.range(0, partitionToNode.size()).toArray(); this.splitToBucket = requireNonNull(splitToBucket, "splitToBucket is null"); }
From source file:io.prestosql.orc.stream.InputStreamSources.java
public InputStreamSources(Map<StreamId, InputStreamSource<?>> streamSources) { this.streamSources = ImmutableMap.copyOf(requireNonNull(streamSources, "streamSources is null")); }
From source file:com.facebook.presto.raptor.storage.OrcFileMetadata.java
@JsonCreator public OrcFileMetadata(@JsonProperty("columnTypes") Map<Long, TypeSignature> columnTypes) { this.columnTypes = ImmutableMap.copyOf(columnTypes); }
From source file:de.flapdoodle.logparser.matcher.stacktrace.AbstractStackElement.java
protected AbstractStackElement(String line, Map<String, String> attributes) { _line = line; _attributes = ImmutableMap.copyOf(attributes); }
From source file:co.cask.cdap.proto.WorkflowTokenDetail.java
public WorkflowTokenDetail(Map<String, List<NodeValueDetail>> tokenData) { this.tokenData = ImmutableMap.copyOf(tokenData); }