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.chef.util.CollectionUtils.java

/**
 * Creates an immutable map with the elements of the given map. If the input
 * map is <code>null</code>, it returns an empty map.
 * //from   w  w w . j a v a  2 s.  c  om
 * @param input
 *           The map used to build the immutable one.
 * @return An immutable map with the elements of the given map.
 */
public static <K, V> ImmutableMap<K, V> copyOfOrEmpty(@Nullable Map<K, V> input) {
    return input == null ? ImmutableMap.<K, V>of() : ImmutableMap.copyOf(input);
}

From source file:com.google.firebase.auth.ImportUserRecord.java

private ImportUserRecord(Map<String, Object> properties) {
    this.properties = ImmutableMap.copyOf(properties);
}

From source file:io.brooklyn.camp.dto.DtoCustomAttributes.java

public DtoCustomAttributes(Map<String, ?> customAttributes) {
    this.customAttributes = customAttributes == null ? ImmutableMap.<String, Object>of()
            : ImmutableMap.copyOf(customAttributes);
}

From source file:nl.tue.gale.ae.processor.PluginProcessor.java

public void setPluginTable(Map<String, Plugin> pluginTable) {
    this.pluginTable = ImmutableMap.copyOf(pluginTable);
}

From source file:com.proofpoint.discovery.client.announce.ServiceAnnouncement.java

private ServiceAnnouncement(String type, Map<String, String> properties) {
    Preconditions.checkNotNull(type, "type is null");
    Preconditions.checkNotNull(properties, "properties is null");

    this.type = type;
    this.properties = ImmutableMap.copyOf(properties);
}

From source file:com.isotrol.impe3.nr.api.RegularNodeFilter.java

private static <K, V> ImmutableMap<K, V> map(Map<K, V> map) {
    if (map == null) {
        return null;
    }/*from  ww  w  .  ja  v  a  2s . c o m*/
    checkArgument(!map.isEmpty(), "Empty map in a regular node filter");
    return ImmutableMap.copyOf(map);
}

From source file:com.spotify.apollo.ResponseImpl.java

@Override
public Response<T> withHeader(String header, String value) {
    // Allow overriding values
    final Map<String, String> headers = new LinkedHashMap<>();
    headers.putAll(headers());//from www .jav a2 s . c  o  m
    headers.put(header, value);

    return createInternal(status(), ImmutableMap.copyOf(headers), payload());
}

From source file:io.druid.segment.realtime.appenderator.Committed.java

@JsonCreator
public Committed(@JsonProperty("hydrants") Map<String, Integer> hydrants,
        @JsonProperty("metadata") Object metadata) {
    this.hydrants = ImmutableMap.copyOf(hydrants);
    this.metadata = metadata;
}

From source file:com.spotify.docker.client.messages.LogConfig.java

private LogConfig(final String logType, final Map<String, String> logOptions) {
    this.logType = logType;
    this.logOptions = ImmutableMap.copyOf(logOptions);
}

From source file:com.arpnetworking.tsdaggregator.model.DefaultRecord.java

/**
 * Public constructor./*from   ww  w.  j  ava2  s.  c  o m*/
 *
 * @param metrics the metrics
 * @param time the time stamp
 * @param annotations the annotations
 * @deprecated Use the <code>Builder</code> instead.
 */
@Deprecated
public DefaultRecord(final Map<String, ? extends Metric> metrics, final DateTime time,
        final Map<String, String> annotations) {
    _metrics = ImmutableMap.copyOf(metrics);
    _time = time;
    _annotations = ImmutableMap.copyOf(annotations);
}