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

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

Introduction

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

Prototype

@Beta
public static <K, V> ImmutableSetMultimap<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:com.google.caliper.bridge.TargetInfoRequest.java

public static TargetInfoRequest create(Multimap<String, String> userParameters) {
    return new AutoValue_TargetInfoRequest(ImmutableSetMultimap.copyOf(userParameters));
}

From source file:com.facebook.presto.tests.tpch.TpchIndexSpec.java

private TpchIndexSpec(SetMultimap<TpchScaledTable, Set<String>> spec) {
    this.spec = ImmutableSetMultimap.copyOf(requireNonNull(spec, "spec is null"));
}

From source file:com.facebook.presto.tpch.TpchIndexSpec.java

private TpchIndexSpec(SetMultimap<TpchScaledTable, Set<String>> spec) {
    this.spec = ImmutableSetMultimap.copyOf(checkNotNull(spec, "spec is null"));
}

From source file:io.prestosql.plugin.hive.metastore.PrincipalPrivileges.java

public PrincipalPrivileges(Multimap<String, HivePrivilegeInfo> userPrivileges,
        Multimap<String, HivePrivilegeInfo> rolePrivileges) {
    this.userPrivileges = ImmutableSetMultimap.copyOf(requireNonNull(userPrivileges, "userPrivileges is null"));
    this.rolePrivileges = ImmutableSetMultimap.copyOf(requireNonNull(rolePrivileges, "rolePrivileges is null"));
}

From source file:org.apache.aurora.scheduler.preemptor.ClusterStateImpl.java

@Override
public Multimap<String, PreemptionVictim> getSlavesToActiveTasks() {
    synchronized (victims) {
        return ImmutableSetMultimap.copyOf(victims);
    }
}

From source file:io.usethesource.criterion.impl.immutable.guava.ImmutableGuavaSetMultimap.java

@Override
public JmhSetMultimap insert(JmhValue key, JmhValue value) {
    final SetMultimap<JmhValue, JmhValue> tmpContent = HashMultimap.create(content);
    tmpContent.put(key, value);//from  ww w.  java  2s . c om

    final ImmutableSetMultimap<JmhValue, JmhValue> newContent = ImmutableSetMultimap.copyOf(tmpContent);

    return new ImmutableGuavaSetMultimap(newContent);

    //    final ImmutableSetMultimap<JmhValue, JmhValue> newContent =
    //        ImmutableSetMultimap.<JmhValue, JmhValue>builder().putAll(content).put(key, value).build();
    //
    //    return new ImmutableGuavaSetMultimap(newContent);
}

From source file:org.xacml4j.v30.BaseDecisionRuleResponse.java

protected BaseDecisionRuleResponse(Builder<?> b) {
    this.id = b.id;
    this.attributes = ImmutableSetMultimap.copyOf(b.attributes);
    this.hashCode = Objects.hashCode(id, attributes);
    this.fulfillOn = b.fullFillOn;
}

From source file:dagger.internal.codegen.TypeCheckingProcessingStep.java

@Override
public ImmutableSet<Element> process(SetMultimap<Class<? extends Annotation>, Element> elementsByAnnotation) {
    ImmutableSet.Builder<Element> deferredElements = ImmutableSet.builder();
    ImmutableSetMultimap.copyOf(elementsByAnnotation).inverse().asMap().forEach((element, annotations) -> {
        try {//from w  w w  . j a  va 2s  .c o m
            process(downcaster.apply(element), ImmutableSet.copyOf(annotations));
        } catch (TypeNotPresentException e) {
            deferredElements.add(element);
        }
    });
    return deferredElements.build();
}

From source file:com.google.errorprone.bugpatterns.apidiff.ApiDiff.java

public static ApiDiff fromMembers(Set<String> unsupportedClasses,
        Multimap<String, ClassMemberKey> unsupportedMembersByClass) {
    return new AutoValue_ApiDiff(ImmutableSet.copyOf(unsupportedClasses),
            ImmutableSetMultimap.copyOf(unsupportedMembersByClass));
}

From source file:com.google.caliper.runner.FullCartesianScenarioSelection.java

public FullCartesianScenarioSelection(Collection<BenchmarkMethod> benchmarkMethods,
        Collection<VirtualMachine> vms, SetMultimap<String, String> userParameters) {
    this.benchmarkMethods = ImmutableSet.copyOf(benchmarkMethods);
    this.vms = ImmutableSet.copyOf(vms);
    this.userParameters = ImmutableSetMultimap.copyOf(userParameters);

    checkArgument(!benchmarkMethods.isEmpty());
    checkArgument(!vms.isEmpty());/*  ww  w  . j av a  2 s . co m*/
}