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.gradle.api.internal.changedetection.state.DefaultFileCollectionSnapshotterRegistry.java

public DefaultFileCollectionSnapshotterRegistry(Collection<FileCollectionSnapshotter> snapshotters) {
    this.snapshotters = ImmutableMap
            .copyOf(Maps.uniqueIndex(snapshotters, new Function<FileCollectionSnapshotter, Class<?>>() {
                @Override/*from   w ww . j  a  va  2s.  co  m*/
                public Class<?> apply(FileCollectionSnapshotter snapshotter) {
                    Class<? extends FileCollectionSnapshotter> registeredType = snapshotter.getRegisteredType();
                    Class<? extends FileCollectionSnapshotter> type = snapshotter.getClass();
                    if (!registeredType.isAssignableFrom(type)) {
                        throw new IllegalArgumentException(String.format(
                                "Snapshotter registered type '%s' must be a super-type of the actual snapshotter type '%s'",
                                registeredType.getName(), type.getName()));
                    }
                    return registeredType;
                }
            }));
}

From source file:com.facebook.presto.dynamodb.DynamodbConnectorFactory.java

public DynamodbConnectorFactory(Map<String, String> optionalConfig) {
    this.optionalConfig = ImmutableMap.copyOf(requireNonNull(optionalConfig, "optionalConfig is null"));
}

From source file:co.cask.cdap.etl.planner.PipelinePlan.java

public PipelinePlan(Map<String, PipelinePhase> phases, Collection<Connection> phaseConnections) {
    this.phases = ImmutableMap.copyOf(phases);
    this.phaseConnections = ImmutableSet.copyOf(phaseConnections);
}

From source file:adept.common.TACKBP2014EAOutput.java

private TACKBP2014EAOutput(String documentId, Map<TACKBP2014EventArgument, Float> scoredResponses) {
    this.documentId = documentId;
    this.scoredResponses = ImmutableMap.copyOf(scoredResponses);
}

From source file:com.eviware.loadui.impl.layout.LayoutComponentImpl.java

public LayoutComponentImpl(Map<String, ?> args) {
    properties = ImmutableMap.copyOf(Maps.filterKeys(args, Predicates.notNull()));
}

From source file:matching.Matches.java

public Matches(final Map<T, T> matches, final Double cost) {
    this.matches = ImmutableMap.copyOf(matches);
    this.cost = cost;
}

From source file:com.google.devtools.build.skyframe.ImmutableDiff.java

public ImmutableDiff(Iterable<SkyKey> valuesToInvalidate, Map<SkyKey, SkyValue> valuesToInject) {
    this.valuesToInvalidate = ImmutableList.copyOf(valuesToInvalidate);
    this.valuesToInject = ImmutableMap.copyOf(valuesToInject);
}

From source file:ratpack.http.internal.ContentNegotiationHandler.java

public ContentNegotiationHandler(Map<String, Handler> handlers, Handler noMatchHandler) {
    this.handlers = ImmutableMap.copyOf(handlers);
    this.noMatchHandler = noMatchHandler;
}

From source file:org.apache.bigtop.datagenerators.samplers.wfs.MultinomialWF.java

public MultinomialWF(Map<T, Double> probabilities) {
    this.weights = ImmutableMap.copyOf(probabilities);
}

From source file:org.eclipse.xtext.validation.ConfigurableIssueCodesProvider.java

public ConfigurableIssueCodesProvider() {
    final Map<String, PreferenceKey> map = Maps.newLinkedHashMap();
    initialize(new IAcceptor<PreferenceKey>() {

        @Override// www .  j  a  va  2 s.  c om
        public void accept(PreferenceKey prefKey) {
            map.put(prefKey.getId(), prefKey);
        }
    });
    this.issueCodes = ImmutableMap.copyOf(map);
}