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:org.jclouds.azurecompute.arm.domain.ResourceDefinition.java

@SerializedNames({ "name", "type", "location", "apiVersion", "dependsOn", "tags", "properties" })
public static ResourceDefinition create(final String name, final String type, final String location,
        final String apiVersion, final List<String> dependsOn, final Map<String, String> tags,
        final Object properties) {
    ResourceDefinition.Builder builder = ResourceDefinition.builder().name(name).type(type).location(location)
            .apiVersion(apiVersion).properties(properties);

    builder.dependsOn(dependsOn == null ? null : ImmutableList.copyOf(dependsOn));

    builder.tags(tags == null ? null : ImmutableMap.copyOf(tags));

    return builder.build();
}

From source file:com.melexis.esb.eventstore.Event.java

public Event(DateTime ts, String source, Map<String, String> attributes) {
    this.timestamp = ts; // DateTime is immutable
    this.source = source;
    this.attributes = ImmutableMap.copyOf(attributes);
}

From source file:io.rhiot.cloudplatform.service.mailbox.InMemoryMailStore.java

public Map<String, Map<String, Object>> mails() {
    return ImmutableMap.copyOf(mails);
}

From source file:db.infra.DenormalizedEntity.java

public DenormalizedEntity<V> replace(String subEntityName, Object subEntity) {
    HashMap<String, Object> map = new HashMap<>(subEntities);
    if (subEntity == null)
        map.remove(subEntityName);/* w ww. j a v a 2s. co m*/
    else
        map.put(subEntityName, subEntity);
    return new DenormalizedEntity<>(parentEntity, ImmutableMap.copyOf(map));
}

From source file:org.apache.provisionr.api.util.WithOptions.java

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

From source file:com.proofpoint.tracetoken.TraceToken.java

TraceToken(Map<String, String> map) {
    requireNonNull(map, "map is null");
    requireNonNull(map.get("id"), "map{id} is null");
    delegate = ImmutableMap.copyOf(map);
}

From source file:net.oneandone.troilus.referentialintegrity.Immutables.java

public static <K, V> ImmutableMap<K, V> merge(ImmutableMap<K, V> map, K key, V value) {
    Map<K, V> m = Maps.newHashMap(map);
    m.put(key, value);/*from  w ww  .  j a va2 s.c o m*/
    return ImmutableMap.copyOf(m);
}

From source file:dk.ilios.spanner.bridge.VmPropertiesLogMessage.java

public VmPropertiesLogMessage() {
    this(ImmutableMap.copyOf(Maps.fromProperties(System.getProperties())));
}

From source file:org.locationtech.geogig.rocksdb.DBConfig.java

public DBConfig(String dbpath, boolean readOnly, Map<String, String> defaultMetadata,
        Set<String> columnFamilyNames) {
    this.dbpath = dbpath;
    this.readOnly = readOnly;
    this.columnFamilyNames = columnFamilyNames;
    this.defaultMetadata = ImmutableMap.copyOf(defaultMetadata);
}

From source file:co.cask.cdap.internal.app.runtime.DefaultTaskLocalizationContext.java

public DefaultTaskLocalizationContext(Map<String, File> localizedResources) {
    this.localizedResources = ImmutableMap.copyOf(localizedResources);
}