Example usage for org.apache.commons.collections MultiMap putAll

List of usage examples for org.apache.commons.collections MultiMap putAll

Introduction

In this page you can find the example usage for org.apache.commons.collections MultiMap putAll.

Prototype

void putAll(Map<? extends K, ? extends V> m);

Source Link

Document

Copies all of the mappings from the specified map to this map (optional operation).

Usage

From source file:net.jadler.stubbing.StubResponse.java

/**
 * @return stub response headers//from www. j a v a2  s  .  c om
 */
@SuppressWarnings("unchecked")
public MultiMap getHeaders() {
    final MultiMap res = new MultiValueMap();
    res.putAll(this.headers);

    return res;
}

From source file:net.jadler.stubbing.Request.java

private Map<String, List<String>> readParameters() throws IOException {
    final MultiMap params = readParametersFromQueryString();

    //TODO: shitty attempt to check whether the body contains html form data. Please refactor.
    if (!StringUtils.isBlank(this.getContentType())
            && this.getContentType().contains("application/x-www-form-urlencoded")) {

        if ("POST".equalsIgnoreCase(this.getMethod()) || "PUT".equalsIgnoreCase(this.getMethod())) {
            params.putAll(this.readParametersFromBody());
        }/* w  w w  .j  a v  a2s .com*/
    }

    final Map<String, List<String>> res = new HashMap<String, List<String>>();
    for (final Object o : params.entrySet()) {
        final Map.Entry<String, List<String>> e = (Map.Entry) o;
        res.put(e.getKey(), unmodifiableList(e.getValue()));
    }

    return unmodifiableMap(res);
}

From source file:fr.in2p3.cc.storage.treqs.control.controller.QueuesController.java

/**
 * Retrieves the list of queues of the controller.
 * //from   w  ww .  j a  va  2s  .c o  m
 * @return Map of queues.
 */
@SuppressWarnings("unchecked")
MultiMap getQueues() {
    LOGGER.trace("> getQueues");

    final MultiMap copy = new MultiValueMap();
    copy.putAll(this.queuesMap);

    LOGGER.trace("< getQueues");

    return copy;
}

From source file:org.lockss.extractor.TestArticleMetadata.java

MultiMap multiMap(Map map) {
    MultiMap res = new MultiValueMap();
    res.putAll(map);
    return res;
}