Utility method useful for creating a parameter map.

@param params The parameters, should be in the format "name", value
@return The parameters map
497400
public static Map<String, ValueCommand> createParameterMap(Object... params) {
        assert params.length % 2 == 0;
        Map<String, ValueCommand> ret = new HashMap<String, ValueCommand>();
        for (int i = 0; i < params.length; i = i + 2) {
            String param = params[i].toString();
            Value value = convertFromJava(params[i + 1]);
            ret.put(param, new LiteralCommand(value));
        }
        return ret;
    }
163882
private static StringMap filterParam(StringMap params) {
        final StringMap ret = new StringMap();
        if (params == null) {
            return ret;
        }
        params.forEach(new StringMap.Consumer() {
            @Override
            public void accept(String key, Object value) {
                if (value == null) {
                    return;
                }
                String val = value.toString();
                if ((key.startsWith("x:") || key.startsWith("x-qn-meta-")) && !val.equals("")) {
                    ret.put(key, val);
                }
            }
        });
        return ret;
    }
1167790
@SuppressWarnings({ "unchecked", "rawtypes" })
    public Map<String, List<String>> parameters() {
        return (Map<String, List<String>>) (Map) parameters.asMap();
    }
531404
public static String generateQuery(final Map<String,Object> params){
		final StringBuilder sb = new StringBuilder();
		boolean newEntry = false;
		
		sb.append("{");
		for(final Entry<String,Object> param: params.entrySet()){
			if(newEntry){
				sb.append(", ");
			}

			sb.append(param.getKey());
			sb.append(": ");
			sb.append(getParam(param.getValue()));
			newEntry = true;
		}
		sb.append("}");
		
		return sb.toString();
	}
458998
function _parseParams(params) {
  return params.map((param) => {
    let result;
    switch (param.type) {
      case 'Identifier':
        result = new Param(param.name);
        break;
      case 'AssignmentPattern':
        result = new Param(param.left.name, true);
        break;
      case 'ObjectPattern': {
        const objParams = param.properties.map((objParam) => objParam.value);
        result = new Param('arguments', false, _parseParams(objParams));
        break;
      }
      default:
    }
    return result;
  });
}
863972
function to_map(params) {
  var map = {};

  params.forEach(function (param, i) {
    param.index = i;
    map[param.name] = param;
  });

  map.length = params.length;

  return map;
}
62543
protected List<String> getResourceNamesFromParam(Map<String, String> params) {

        String resourcesParam = "/";
        if (params.containsKey(I_CmsListResourceCollector.PARAM_RESOURCES)) {
            resourcesParam = params.get(I_CmsListResourceCollector.PARAM_RESOURCES);
        }
        if (resourcesParam.length() == 0) {
            return Collections.emptyList();
        }
        return CmsStringUtil.splitAsList(resourcesParam, "#");
    }
1195413
public String params(String param) {
        if (param == null) {
            return null;
        }

        if (param.startsWith(":")) {
            return params.get(param.toLowerCase()); // NOSONAR
        } else {
            return params.get(":" + param.toLowerCase()); // NOSONAR
        }
    }
1206722
public static Map<String, Object> with(Object... params) {
        Map<String, Object> map = new HashMap<>();
        for (int i = 0; i < params.length; i++) {
            map.put(String.valueOf(i), params[i]);
        }
        return map;
    }
237479
public UrlStringBuilder setParameters(String namespace, Map<String, List<String>> parameters) {
        for (final String name : parameters.keySet()) {
            Validate.notNull(name, "parameter map cannot contain any null keys");
        }

        this.parameters.clear();
        this.addParameters(namespace, parameters);
        return this;
    }
1214118
private CmsSearchParameters getSearchParameters(Map<String, String> params) {

        CmsSearchParameters searchParams = new CmsSearchParameters();
        searchParams.setQuery(params.get(PARAM_QUERY));
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(params.get(PARAM_SORT))) {
            searchParams.setSortName(params.get(PARAM_SORT));
        }
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(params.get(PARAM_MINCREATIONDATE))) {
            searchParams.setMinDateCreated(Long.parseLong(params.get(PARAM_MINCREATIONDATE)));
        }
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(params.get(PARAM_MAXCREATIONDATE))) {
            searchParams.setMaxDateCreated(Long.parseLong(params.get(PARAM_MAXCREATIONDATE)));
        }
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(params.get(PARAM_MINLASTMODIFICATIONDATE))) {
            searchParams.setMinDateLastModified(Long.parseLong(params.get(PARAM_MINLASTMODIFICATIONDATE)));
        }
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(params.get(PARAM_MAXLASTMODIFICATIONDATE))) {
            searchParams.setMaxDateLastModified(Long.parseLong(params.get(PARAM_MAXLASTMODIFICATIONDATE)));
        }
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(params.get(PARAM_INDEXNAME))) {
            searchParams.setIndex(params.get(PARAM_INDEXNAME));
        }

        List<String> fields = CmsStringUtil.splitAsList(params.get(PARAM_FIELDS), ',');
        searchParams.setFields(fields);
        searchParams.setSearchPage(Integer.parseInt(params.get(I_CmsListResourceCollector.PARAM_PAGE)));
        return searchParams;
    }
672591
protected QueryParameters[] getQueryParams(Object[][] params) {
        QueryParameters[] result = new QueryParameters[params.length];

        for (int i = 0; i < params.length; i++) {
            result[i] = new QueryParameters(params[i]);
        }

        return result;
    }
348119
public Map/*< String, List< String > >*/ getParameters()
    {
        if(_parameters == null || !_parameters.hasParameters())
            return Collections.EMPTY_MAP;
        else return _parameters.getParameters();
    }
105093
public static final ParseResult parseParams(Object[] params) {
		Tree data = null;
		CallOptions.Options opts = null;
		Groups groups = null;
		PacketStream stream = null;
		if (params != null) {
			if (params.length == 1) {
				if (params[0] instanceof Tree) {
					data = (Tree) params[0];
				} else if (params[0] instanceof CallOptions.Options) {
					opts = (CallOptions.Options) params[0];
				} else if (params[0] instanceof Groups) {
					groups = (Groups) params[0];
				} else if (params[0] instanceof PacketStream) {
					data = new Tree();
					stream = (PacketStream) params[0];
				} else {
					data = new CheckedTree(params[0]);
				}
			} else {
				LinkedHashMap<String, Object> map = new LinkedHashMap<>();
				String prev = null;
				Object value;
				for (int i = 0; i < params.length; i++) {
					value = params[i];
					if (prev == null) {
						if (!(value instanceof String)) {
							if (value instanceof CallOptions.Options) {
								opts = (CallOptions.Options) value;
								continue;
							}
							if (value instanceof Groups) {
								groups = (Groups) value;
								continue;
							}
							if (value instanceof PacketStream) {
								stream = (PacketStream) value;
								continue;
							}
							i++;
							throw new IllegalArgumentException("Parameter #" + i + " (\"" + value
									+ "\") must be String, Context, Groups, PacketStream or CallOptions!");
						}
						prev = (String) value;
						continue;
					}
					map.put(prev, value);
					prev = null;
				}
				data = new Tree(map);
			}
		}
		return new ParseResult(data, opts, groups, stream);
	}
744040
private static Map<String, Object> convert(
        final Map<CharSequence, Object> params) {
        final Map<String, Object> map = new HashMap<>(params.size());
        for (final Map.Entry<CharSequence, Object> ent : params.entrySet()) {
            map.put(ent.getKey().toString(), ent.getValue());
        }
        return map;
    }
908352
public Map<String, String> paramMap() {
        Map<String, String> params = new HashMap<>();

        if (getQuery() != null)
            params.put("q", getQuery());
        if (getMode() != null)
            params.put("mode", getMode().toString());
        if (getStatus() != null)
            params.put("status", getStatus());
        if (getAssignedTo() != null)
            params.put("assigned_to", getAssignedTo());
        if (getModifiedFrom() != null)
            params.put("modified_from", getModifiedFrom());
        if (getModifiedTo() != null)
            params.put("modified_to", getModifiedTo());
        if (getPublishedFrom() != null)
            params.put("published_from", getPublishedFrom());
        if (getPublishedTo() != null)
            params.put("published_to", getPublishedTo());
        if (getCount() != null)
            params.put("count", getCount().toString());
        if (getOffset() != null)
            params.put("offset", getOffset().toString());
        if (getOrderBy() != null)
            params.put("order", getOrderBy());
        if (getOutputType() != null)
            params.put("output_type", getOutputType().toString());

        return params;
    }
250584
public static JSONObject getJsonParameterMap(Map<String, String[]> params) {

        JSONObject result = new JSONObject();
        for (Map.Entry<String, String[]> entry : params.entrySet()) {
            String paramKey = entry.getKey();
            JSONArray paramValue = new JSONArray();
            for (int i = 0, l = entry.getValue().length; i < l; i++) {
                paramValue.put(entry.getValue()[i]);
            }
            try {
                result.putOpt(paramKey, paramValue);
            } catch (JSONException e) {
                // should never happen
                LOG.warn(e.getLocalizedMessage(), e);
            }
        }
        return result;
    }