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:se.curity.examples.oauth.FilterHelper.java

static ImmutableMultimap<String, String> initParamsMapFrom(FilterConfig config) {
    Multimap<String, String> result = Multimaps.newListMultimap(new LinkedHashMap<>(), ArrayList::new);

    Enumeration<?> names = config.getInitParameterNames();
    while (names.hasMoreElements()) {
        String name = names.nextElement().toString();
        if (config.getInitParameter(name) != null) {
            result.put(name, config.getInitParameter(name));
        }//from   w  w  w  .  jav a 2  s.  c  o m
    }
    return ImmutableMultimap.copyOf(result);
}

From source file:at.ac.univie.isc.asio.engine.Command.java

/** create a valid command with given arguments */
static Command create(final Multimap<String, String> properties, final List<MediaType> accepted,
        final Principal owner) {
    return new AutoValue_Command(ImmutableMultimap.copyOf(properties), ImmutableList.copyOf(accepted),
            Optional.fromNullable(owner));
}

From source file:io.takari.maven.plugins.compile.jdt.classpath.Classpath.java

private static Multimap<String, ClasspathEntry> newPackageIndex(List<ClasspathEntry> entries) {
    Multimap<String, ClasspathEntry> classpath = LinkedHashMultimap.create();
    for (ClasspathEntry entry : entries) {
        for (String packageName : entry.getPackageNames()) {
            classpath.put(packageName, entry);
        }/*from ww w  .j  a v  a  2s.co m*/
    }
    return ImmutableMultimap.copyOf(classpath); // preserves order
}

From source file:com.continuuity.weave.internal.Arguments.java

public Arguments(List<String> arguments, Multimap<String, String> runnableArguments) {
    this.arguments = ImmutableList.copyOf(arguments);
    this.runnableArguments = ImmutableMultimap.copyOf(runnableArguments);
}

From source file:sf.net.experimaestro.manager.plans.PlanInputs.java

public Multimap<DotName, Operator> getMap() {
    return ImmutableMultimap.copyOf(map);
}

From source file:com.google.devtools.build.lib.analysis.extra.ExtraActionMapProvider.java

public ExtraActionMapProvider(Multimap<String, ExtraActionSpec> extraActionMap) {
    this.extraActionMap = ImmutableMultimap.copyOf(extraActionMap);
}

From source file:org.glowroot.agent.plugin.jdbc.JdbcPluginProperties.java

public static void setDisplayBinaryParameterAsHex(String sql, int parameterIndex) {
    HashMultimap<String, Integer> mutableMultimap = HashMultimap.create(displayBinaryParameterAsHex);
    mutableMultimap.put(sql, parameterIndex);
    displayBinaryParameterAsHex = ImmutableMultimap.copyOf(mutableMultimap);
}

From source file:com.google.devtools.build.lib.packages.AspectParameters.java

private AspectParameters(Multimap<String, String> attributes) {
    this.attributes = ImmutableMultimap.copyOf(attributes);
}

From source file:com.isotrol.impe3.api.PageURI.java

public PageURI(final PathSegments path, Multimap<String, String> parameters) {
    this.path = (path != null) ? path : PathSegments.of();
    if (parameters != null) {
        this.parameters = ImmutableMultimap.copyOf(parameters);
    } else {//w ww  . j av  a2  s  . co m
        this.parameters = ImmutableMultimap.of();
    }
}

From source file:works.chatterbox.hooks.ircchannels.channels.invites.Invites.java

public Multimap<UUID, String> getAllInvites() {
    return ImmutableMultimap.copyOf(this.invites);
}