Example usage for com.google.common.collect ImmutableMultimap copyOf

List of usage examples for com.google.common.collect ImmutableMultimap copyOf

Introduction

In this page you can find the example usage for com.google.common.collect ImmutableMultimap copyOf.

Prototype

@Beta
public static <K, V> ImmutableMultimap<K, V> copyOf(
        Iterable<? extends Entry<? extends K, ? extends V>> entries) 

Source Link

Document

Returns an immutable multimap containing the specified entries.

Usage

From source file:org.mule.module.extension.internal.manager.ConfigurationsStateTracker.java

Multimap<Configuration, ConfigurationInstanceWrapper<?>> getConfigurationInstances() {
    return ImmutableMultimap.copyOf(configurationInstances);
}

From source file:com.textocat.textokit.morph.commons.AgreementPredicate.java

private AgreementPredicate(GramModel gm, Multimap<BitSet, BitSet> agreementMap) {
    this.gramModel = gm;
    this.agreementMap = ImmutableMultimap.copyOf(agreementMap);
    categoryMask = new BitSet();
    for (Map.Entry<BitSet, BitSet> e : agreementMap.entries()) {
        categoryMask.or(e.getKey());//ww w.  j  av  a  2  s  . co  m
        categoryMask.or(e.getValue());
    }
    // done
}

From source file:org.jclouds.elb.domain.Policy.java

protected Policy(String name, String typeName, Multimap<String, Object> attributes) {
    this.name = checkNotNull(name, "name");
    this.typeName = checkNotNull(typeName, "typeName");
    this.attributes = ImmutableMultimap.copyOf(checkNotNull(attributes, "attributes"));
}

From source file:org.eclipse.tracecompass.tmf.core.analysis.TmfAnalysisManager.java

/**
 * Gets all available analysis module helpers
 *
 * This map is read-only/* w ww.ja va  2 s .c o m*/
 *
 * @return The map of available {@link IAnalysisModuleHelper}
 * @since 1.0
 */
public static synchronized Multimap<String, IAnalysisModuleHelper> getAnalysisModules() {
    if (fAnalysisModules.isEmpty()) {
        for (IAnalysisModuleSource source : fSources) {
            for (IAnalysisModuleHelper helper : source.getAnalysisModules()) {
                fAnalysisModules.put(helper.getId(), helper);
            }
        }
    }
    return checkNotNull(ImmutableMultimap.copyOf(fAnalysisModules));
}

From source file:org.iq80.leveldb.impl.VersionEdit.java

public Multimap<Integer, FileMetaData> getNewFiles() {
    return ImmutableMultimap.copyOf(newFiles);
}

From source file:org.sosy_lab.cpachecker.core.defaults.precision.LocalizedRefinablePrecision.java

@Override
public VariableTrackingPrecision join(VariableTrackingPrecision consolidatedPrecision) {
    checkArgument(getClass().equals(consolidatedPrecision.getClass()));
    checkArgument(/*from w w w .j  av a  2 s.  co m*/
            super.getBaseline().equals(((LocalizedRefinablePrecision) consolidatedPrecision).getBaseline()));

    SetMultimap<CFANode, MemoryLocation> joinedPrec = TreeMultimap.create(rawPrecision);
    joinedPrec.putAll(((LocalizedRefinablePrecision) consolidatedPrecision).rawPrecision);
    return new LocalizedRefinablePrecision(super.getBaseline(), ImmutableMultimap.copyOf(joinedPrec));
}

From source file:com.google.devtools.build.lib.query2.output.PreciseAspectResolver.java

@Override
public ImmutableMultimap<Attribute, Label> computeAspectDependencies(Target target,
        DependencyFilter dependencyFilter) throws InterruptedException {
    Multimap<Attribute, Label> result = LinkedListMultimap.create();
    if (target instanceof Rule) {
        Multimap<Attribute, Label> transitions = ((Rule) target)
                .getTransitions(DependencyFilter.NO_NODEP_ATTRIBUTES);
        for (Entry<Attribute, Label> entry : transitions.entries()) {
            Target toTarget;//from   w w  w . j  a v a  2 s .  c om
            try {
                toTarget = packageProvider.getTarget(eventHandler, entry.getValue());
                result.putAll(AspectDefinition.visitAspectsIfRequired(target, entry.getKey(), toTarget,
                        dependencyFilter));
            } catch (NoSuchThingException e) {
                // Do nothing. One of target direct deps has an error. The dependency on the BUILD file
                // (or one of the files included in it) will be reported in the query result of :BUILD.
            }
        }
    }
    return ImmutableMultimap.copyOf(result);
}

From source file:org.apache.calcite.rel.metadata.ReflectiveRelMetadataProvider.java

/**
 * Creates a ReflectiveRelMetadataProvider.
 *
 * @param map Map/*  ww w .j  a  v a 2 s.c om*/
 * @param metadataClass0 Metadata class
 * @param handlerMap Methods handled and the objects to call them on
 */
protected ReflectiveRelMetadataProvider(ConcurrentMap<Class<RelNode>, UnboundMetadata> map,
        Class<? extends Metadata> metadataClass0, Multimap<Method, MetadataHandler> handlerMap) {
    assert !map.isEmpty() : "are your methods named wrong?";
    this.map = map;
    this.metadataClass0 = metadataClass0;
    this.handlerMap = ImmutableMultimap.copyOf(handlerMap);
}

From source file:org.sosy_lab.cpachecker.util.predicates.matching.SmtAstMatchResultImpl.java

@Override
public ImmutableMultimap<SmtAstPatternSelectionElement, Formula> getMatchings() {
    return ImmutableMultimap.copyOf(argumentPatternMatches);
}

From source file:org.kiji.schema.impl.HBaseKijiTableReaderBuilder.java

/** {@inheritDoc} */
@Override/*from w w w  .j  av a 2s.co  m*/
public KijiTableReaderBuilder withColumnReaderSpecAlternatives(
        final Multimap<KijiColumnName, ColumnReaderSpec> alternatives) {
    Preconditions.checkNotNull(alternatives, "ColumnReaderSpec alternatives may not be null.");
    Preconditions.checkState(null == mAlternatives, "ColumnReaderSpec alternatives already set to: %s",
            mAlternatives);
    mAlternatives = ImmutableMultimap.copyOf(alternatives);
    return this;
}