Example usage for org.apache.solr.common.params ModifiableSolrParams getMap

List of usage examples for org.apache.solr.common.params ModifiableSolrParams getMap

Introduction

In this page you can find the example usage for org.apache.solr.common.params ModifiableSolrParams getMap.

Prototype

public Map<String, String[]> getMap() 

Source Link

Usage

From source file:org.vootoo.client.netty.util.ProtobufUtil.java

License:Apache License

public static List<SolrProtocol.Param> toProtobufParams(SolrParams solrParams) {
    List<SolrProtocol.Param> paramList;
    if (solrParams instanceof ModifiableSolrParams) {
        ModifiableSolrParams mps = (ModifiableSolrParams) solrParams;
        Map<String, String[]> maps = mps.getMap();
        paramList = new ArrayList<>(maps.size());
        for (Map.Entry<String, String[]> e : maps.entrySet()) {
            paramList.add(toProtobufParam(e.getKey(), e.getValue()));
        }/*from ww  w. jav a2s .  c  o  m*/
    } else {
        paramList = new ArrayList<>();
        Iterator<String> it = solrParams.getParameterNamesIterator();
        while (it.hasNext()) {
            String key = it.next();
            String[] values = solrParams.getParams(key);
            paramList.add(toProtobufParam(key, values));
        }
    }
    return paramList;
}