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:keywhiz.api.CreateGroupRequest.java

public CreateGroupRequest(@JsonProperty("name") String name,
        @Nullable @JsonProperty("description") String description,
        @Nullable @JsonProperty("metadata") ImmutableMap<String, String> metadata) {
    this.name = name;
    this.description = description;
    this.metadata = metadata == null ? ImmutableMap.of() : ImmutableMap.copyOf(metadata);
}

From source file:com.google.gxp.compiler.base.Call.java

public Call(SourcePosition sourcePosition, String displayName, Schema schema, Map<String, Attribute> attributes,
        List<String> attrBundles) {
    super(sourcePosition, displayName, schema);
    this.attributes = ImmutableMap.copyOf(attributes);
    this.attrBundles = ImmutableList.copyOf(attrBundles);
}

From source file:com.opengamma.strata.calc.runner.DefaultCalculationFunctions.java

/**
 * Obtains an instance from the specified functions.
 * <p>/*www.ja  v  a 2 s . c  om*/
 * The map will be validated to ensure the {@code Class} is consistent with
 * {@link CalculationFunction#targetType()}.
 * 
 * @param functions  the functions
 * @return the calculation functions
 */
static DefaultCalculationFunctions of(Map<Class<?>, ? extends CalculationFunction<?>> functions) {
    return new DefaultCalculationFunctions(ImmutableMap.copyOf(functions));
}

From source file:com.google.caliper.runner.CaliperRc.java

public CaliperRc(Map<String, String> props) {
    this.props = ImmutableMap.copyOf(props);
}

From source file:io.airlift.event.client.EventSubmissionFailedException.java

public EventSubmissionFailedException(String type, String pool, Map<URI, ? extends Throwable> causes) {
    super(format("Failed to submit events to service=[%s], pool [%s]", type, pool));

    Preconditions.checkNotNull(causes, "causes is null");

    Throwable cause = find(causes.values(), notNull(), null);
    initCause(cause);//w  w  w.j  a  v  a2 s  . c o m

    this.causes = ImmutableMap.copyOf(causes);
}

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

public DefaultTwillRunnableSpecification(String className, String name, Map<String, String> arguments) {
    this.className = className;
    this.name = name;
    this.arguments = ImmutableMap.copyOf(arguments);
}

From source file:io.druid.indexing.kafka.KafkaPartitions.java

@JsonCreator
public KafkaPartitions(@JsonProperty("topic") final String topic,
        @JsonProperty("partitionOffsetMap") final Map<Integer, Long> partitionOffsetMap) {
    this.topic = topic;
    this.partitionOffsetMap = ImmutableMap.copyOf(partitionOffsetMap);

    // Validate partitionOffsetMap
    for (Map.Entry<Integer, Long> entry : partitionOffsetMap.entrySet()) {
        Preconditions.checkArgument(entry.getValue() >= 0,
                String.format("partition[%d] offset[%d] invalid", entry.getKey(), entry.getValue()));
    }//from  www.  j  a v a 2  s  . com
}

From source file:org.opendaylight.mdsal.dom.store.inmemory.InMemoryShardDataModificationFactory.java

InMemoryShardDataModificationFactory(final DOMDataTreeIdentifier root,
        final Map<PathArgument, WriteableModificationNode> children,
        final Map<DOMDataTreeIdentifier, ForeignShardModificationContext> childShards) {
    this.root = Preconditions.checkNotNull(root);
    this.children = ImmutableMap.copyOf(children);
    this.childShards = ImmutableMap.copyOf(childShards);
}

From source file:co.cask.tigon.sql.internal.DefaultInputFlowletSpecification.java

public DefaultInputFlowletSpecification(String name, String description,
        Map<String, Map.Entry<InputStreamFormat, StreamSchema>> inputSchemas, Map<String, String> sql) {
    this.name = name;
    this.description = description;
    this.inputSchemas = ImmutableMap.copyOf(inputSchemas);
    this.sql = ImmutableMap.copyOf(sql);
}

From source file:backtype.storm.generated.ComponentCommon.java

public ComponentCommon(Map<GlobalStreamId, Grouping> inputs, Map<String, StreamInfo> streams,
        Number parallelismHint, Map<String, Object> conf) {
    this.inputs = ImmutableMap.copyOf(inputs);
    this.streams = ImmutableMap.copyOf(streams);
    this.conf = ImmutableMap.copyOf(conf);
    this.parallelismHint = parallelismHint;
}