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:co.cask.cdap.data.stream.service.upload.FileContentWriterFactory.java

public FileContentWriterFactory(StreamConfig streamConfig, ConcurrentStreamWriter streamWriter,
        Map<String, String> headers) throws IOException {
    this.streamConfig = streamConfig;
    this.streamWriter = streamWriter;
    this.headers = ImmutableMap.copyOf(headers);

    Location location = streamConfig.getLocation();
    if (location == null) {
        // Should never happen
        throw new IllegalArgumentException("Unknown stream location for stream " + streamConfig.getStreamId());
    }/*from w ww .java2s  . co m*/
    this.streamTmpLocation = location.append("tmp");
}

From source file:com.google.javascript.jscomp.newtypes.TypeParameters.java

private TypeParameters(Map<String, Node> typeParams) {
    this.typeParams = ImmutableMap.copyOf(typeParams);
}

From source file:com.facebook.presto.byteCode.DynamicClassLoader.java

public DynamicClassLoader(ClassLoader parentClassLoader, Map<Long, MethodHandle> callSiteBindings) {
    super(resolveClassLoader(parentClassLoader));
    this.callSiteBindings = ImmutableMap.copyOf(callSiteBindings);
}

From source file:de.uniulm.omi.cloudiator.visor.monitoring.MeasurementImpl.java

@Override
public Map<String, String> tags() {
    return ImmutableMap.copyOf(tags);
}

From source file:com.axemblr.provisionr.api.software.Software.java

Software(String baseOperatingSystem, Map<String, String> files, List<String> packages,
        Map<String, String> options) {
    super(options);
    this.baseOperatingSystem = checkNotNull(baseOperatingSystem, "baseOperatingSystem is null");
    this.files = ImmutableMap.copyOf(files);
    this.packages = ImmutableList.copyOf(packages);
}

From source file:org.hawkular.metrics.model.param.Tags.java

/**
 * Null or blank names or values are not permitted. Names and values can't have
 *
 * @param tags values as a {@link Map}/*w ww .j a va 2 s .  c o  m*/
 */
public Tags(Map<String, String> tags) {
    checkArgument(tags != null, "tags is null");
    Stream<Map.Entry<String, String>> entryStream = tags.entrySet().stream();
    checkArgument(entryStream.allMatch(Tags::isValid), "Invalid tag name or value: %s", tags);
    this.tags = ImmutableMap.copyOf(tags);
}

From source file:org.fenixedu.cms.domain.CMSThemeFiles.java

public CMSThemeFiles(Map<String, CMSThemeFile> files) {
    this.files = ImmutableMap.copyOf(files);
    this.checksum = computeChecksum();
}

From source file:com.github.fge.uritemplate.vars.values.MapValue.java

private MapValue(final Builder builder) {
    super(ValueType.MAP);
    map = ImmutableMap.copyOf(builder.map);
}

From source file:org.jclouds.demo.paas.PlatformServices.java

public PlatformServices(String baseUrl, Scheduler scheduler, Map<String, TaskQueue> taskQueues) {
    this.baseUrl = baseUrl;
    this.scheduler = scheduler;
    this.taskQueues = ImmutableMap.copyOf(taskQueues);
}

From source file:com.opengamma.integration.viewer.status.impl.SimpleViewStatusModel.java

public SimpleViewStatusModel(List<List<String>> columnHeaders, List<List<Object>> rows,
        Map<ViewStatusKey, ViewStatus> viewStatusResult) {
    ArgumentChecker.notNull(columnHeaders, "columnHeaders");
    ArgumentChecker.notNull(rows, "rows");
    ArgumentChecker.notNull(viewStatusResult, "viewStatusResult");

    _columnHeaders = deepCopyHeaders(columnHeaders);
    _rows = deepCopyRows(rows);//from   w  ww . j  a  v  a  2  s.  c o  m
    _viewStatusResult = ImmutableMap.copyOf(viewStatusResult);
}