Example usage for com.google.common.collect Multimap put

List of usage examples for com.google.common.collect Multimap put

Introduction

In this page you can find the example usage for com.google.common.collect Multimap put.

Prototype

boolean put(@Nullable K key, @Nullable V value);

Source Link

Document

Stores a key-value pair in this multimap.

Usage

From source file:com.zimbra.soap.account.type.Prop.java

public static Multimap<String, String> toMultimap(List<Prop> props, String userPropKey) {
    Multimap<String, String> map = ArrayListMultimap.create();
    for (Prop p : props) {
        map.put(userPropKey, p.getSerialization());
    }/*w ww .  ja v  a2s  .c o m*/
    return map;
}

From source file:com.eucalyptus.simpleworkflow.common.client.WorkflowRegistry.java

private static void register(final Multimap<Class<? extends ComponentId>, Class<?>> registry,
        final Class<? extends ComponentId> componentIdClass, final Class<?> implementationClass) {
    registry.put(componentIdClass, implementationClass);
}

From source file:com.github.naios.wide.framework.internal.storage.server.builder.SQLBuilderImpl.java

private static Multimap<ServerStorageStructure, SQLUpdateInfo> splitUpdateInfo(
        final Collection<SQLUpdateInfo> updates) {
    final Multimap<ServerStorageStructure, SQLUpdateInfo> map = HashMultimap.create();
    updates.forEach(update -> map.put(MappingBeans.getStructure(update.getProperty()), update));
    return map;//from   w  ww  .  j  a v  a 2  s  .  c o m
}

From source file:com.google.testing.testify.risk.frontend.server.util.DataRequestDocumentGenerator.java

private static Multimap<Long, DataRequest> getRequestsByProject(Collection<DataRequest> requests) {
    Multimap<Long, DataRequest> requestsByProject = HashMultimap.create();
    for (DataRequest request : requests) {
        requestsByProject.put(request.getParentProjectId(), request);
    }//w  ww . ja  v a2 s .  c o m
    return requestsByProject;
}

From source file:org.calrissian.mango.uri.support.UriUtils.java

public static Multimap<String, String> splitQuery(String query) throws UnsupportedEncodingException {
    Multimap<String, String> query_pairs = LinkedListMultimap.create();
    String[] pairs = query.split("&");
    for (String pair : pairs) {
        int idx = pair.indexOf("=");
        query_pairs.put(URLDecoder.decode(pair.substring(0, idx), "UTF-8"),
                URLDecoder.decode(pair.substring(idx + 1), "UTF-8"));
    }//from w w w .j av  a2  s  .  c  o  m
    return query_pairs;
}

From source file:com.google.testing.testify.risk.frontend.server.util.DataRequestDocumentGenerator.java

private static Multimap<String, DataRequest> getRequestsByDataSource(Collection<DataRequest> requests) {
    Multimap<String, DataRequest> requestsBySource = HashMultimap.create();
    for (DataRequest request : requests) {
        requestsBySource.put(request.getDataSourceName(), request);
    }/*from  w  w  w.  ja v a  2 s .c o m*/

    return requestsBySource;
}

From source file:co.cask.cdap.internal.app.runtime.plugin.PluginClassLoaders.java

/**
 * Returns a {@link Multimap} from {@link Plugin} to set of classes used by the program.
 *///from   w w  w  . j av a 2  s  . co  m
private static Multimap<Plugin, String> getArtifactPluginClasses(Map<String, Plugin> plugins) {
    Multimap<Plugin, String> result = HashMultimap.create();
    for (Map.Entry<String, Plugin> entry : plugins.entrySet()) {
        result.put(entry.getValue(), entry.getValue().getPluginClass().getClassName());
    }
    return result;
}

From source file:i5.las2peer.services.recommender.librec.data.DiagMatrix.java

public static DiagMatrix eye(int n) {
    Table<Integer, Integer, Double> vals = HashBasedTable.create();
    Multimap<Integer, Integer> colMap = HashMultimap.create();
    for (int i = 0; i < n; i++) {
        vals.put(i, i, 1.0);/*ww  w  .j  a v  a  2  s  .co m*/
        colMap.put(i, i);
    }

    return new DiagMatrix(n, n, vals, colMap);
}

From source file:uk.ac.ebi.intact.dataexchange.psimi.solr.params.UrlSolrParams.java

private static Multimap<String, String> getQueryMap(String query) {
    String[] params = query.split("&");
    Multimap<String, String> map = HashMultimap.create();

    for (String param : params) {
        String name = param.split("=")[0];
        String value = param.split("=")[1];
        map.put(name, value);
    }// w  w w  .ja v  a2 s  .co m
    return map;
}

From source file:eu.tomylobo.routes.util.Ini.java

public static void saveWorld(Multimap<String, String> section, String format, World world) {
    section.put(String.format(format, "world"), world == null ? "null" : world.getName());
}