For a list of parameters, generate a URL query string.
<p>
Does not include a leading "?" character.

@param parameters
The parameters to stringify.
@return A URL query string representation of the given {@code parameters}.
198149
protected String generateParameterString(List<Parameter> parameters) {
    if (parameters == null) {
      return "";
    }

    StringBuilder parameterStringBuilder = new StringBuilder();
    boolean first = true;

    for (Parameter parameter : parameters) {
      if (first) {
        first = false;
      } else {
        parameterStringBuilder.append("&");
      }

      parameterStringBuilder.append(urlEncode(parameter.name));
      parameterStringBuilder.append("=");
      parameterStringBuilder.append(urlEncode(parameter.value));
    }

    return parameterStringBuilder.toString();
  }
568749
private static String urlEncodeParameter(String parameter) {
        try {
            return URLEncoder.encode(parameter, "UTF-8");
        } catch (UnsupportedEncodingException ex) {
            log.warn("Could not encode parameter.", ex);
        }
        return parameter;
    }
1137005
private static String queryString( final Map<String, List<String>> params ) {
        final StringBuilder builder = new StringBuilder();
        if (params != null && params.size() > 0) {
            for (final Iterator<String> it = params.keySet().iterator(); it.hasNext(); ) {
                final String key = it.next();
                final List<String> values = params.get(key);
                for (final String value : values) {
                    try {
                        builder.append(key + "=" + URLEncoder.encode(value, "UTF-8") + "&");
                    } catch (final UnsupportedEncodingException e) {
                        builder.append(key + "=" + value + "&");
                    }
                }
            }
            return builder.length() > 0 ? "?" + builder.substring(0, builder.length() - 1) : "";
        }
        return "";
    }
640242
public DatabaseConnectionRequest<T, U> addParameters(Map<String, Object> parameters) {
        request.addParameters(parameters);
        return this;
    }
594309
public UrlStringBuilder addParameters(String namespace, Map<String, List<String>> parameters) {
        for (final String name : parameters.keySet()) {
            Validate.notNull(name, "parameter map cannot contain any null keys");
        }

        for (final Map.Entry<String, List<String>> newParamEntry : parameters.entrySet()) {
            final String name = newParamEntry.getKey();
            final List<String> values = this.copy(newParamEntry.getValue());

            this.parameters.put(namespace + name, values);
        }
        return this;
    }
538432
protected static List<String> formatMessageParameters(Object[] parameters) {
        List<String> stringParameters = new ArrayList<>(parameters.length);
        for (Object parameter : parameters) {
            stringParameters.add((parameter != null) ? parameter.toString() : null);
        }
        return stringParameters;
    }
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;
    }
668217
public void decodeQueryTo(MultiMap<String> parameters) {
        if (_query == null)
            return;
        UrlEncoded.decodeUtf8To(_query, parameters);
    }
1115446
public static String getParameterName(Parameter parameter) {
        // identify parameter name and pattern from method signature
        String methodParameterName = parameter.getName();
        if (parameter.isAnnotationPresent(Param.class)) {
            Param param = parameter.getAnnotation(Param.class);
            if (!Strings.isNullOrEmpty(param.value())) {
                methodParameterName = param.value();
            }
        }
        return methodParameterName;
    }
1195431
public String print(Map<String, String> parameters)
    {
        StringBuilder builder = new StringBuilder();

        for (Map.Entry<String, String> entry : parameters.entrySet()) {
            String value = entry.getValue();
            String key = entry.getKey();

            if (key != null && value != null) {
                if (builder.length() > 0) {
                    builder.append(' ');
                }
                builder.append(print(key, value));
            }
        }

        return builder.toString();
    }
980325
private static String getUrlParameters(
        final Collection<Pair<String,String>> parameters, 
        final boolean formEncoding)
        {
        final StringBuilder sb = new StringBuilder ();
        final Iterator<Pair<String,String>> i = parameters.iterator ();
        
        if (i.hasNext ())
            {
            final Pair<String,String> first = i.next ();
            
            sb.append ('?');
            sb.append (getKeyValuePair (first, formEncoding));
            
            while (i.hasNext ())
                {
                final Pair<String,String> current = i.next ();
                
                sb.append ('&');
                sb.append (getKeyValuePair (current, formEncoding));
                }
            
            return sb.toString ();
            }
        else
            {
            return sb.toString ();
            }
        }
1191722
public static List<String> extractPathParams(final String url) {

    final List<String> pathParams = new ArrayList<>();
    int index = url.indexOf('{');

    while (index >= 0) {

      final int endIndex = url.indexOf('}', index);
      final String pathParam = url.substring(index + 1, endIndex);
      pathParams.add(pathParam);
      index = url.indexOf('{', endIndex);
    }

    return pathParams;
  }
67692
public static String format (
            final List <? extends NameValuePair> parameters,
            final String encoding) {
        final StringBuilder result = new StringBuilder();
        for (final NameValuePair parameter : parameters) {
            final String encodedName = encode(parameter.getName(), encoding);
            final String value = parameter.getValue();
            final String encodedValue = value != null ? encode(value, encoding) : "";
            if (result.length() > 0)
                result.append(PARAMETER_SEPARATOR);
            result.append(encodedName);
            result.append(NAME_VALUE_SEPARATOR);
            result.append(encodedValue);
        }
        return result.toString();
    }
151666
@Override
    public Map<String, List<String>> parameters() {
        Map<String, List<String>> result = new HashMap<>();
        for (String key : request.params().names()) {
            result.put(key, request.params().getAll(key));
        }
        return result;
    }
1320175
public Table withParameters(java.util.Map<String, String> parameters) {
        setParameters(parameters);
        return this;
    }
934680
private static String buildUrlWithQueryString(String url, Map<String, String> queryParas) {
		if (queryParas == null || queryParas.isEmpty())
			return url;
		
		StringBuilder sb = new StringBuilder(url);
		boolean isFirst;
		if (!url.contains("?")) {
			isFirst = true;
			sb.append("?");
		}
		else {
			isFirst = false;
		}
		
		for (Entry<String, String> entry : queryParas.entrySet()) {
			if (isFirst) isFirst = false;	
			else sb.append("&");
			
			String key = entry.getKey();
			String value = entry.getValue();
			if (StrKit.notBlank(value))
				try {value = URLEncoder.encode(value, CHARSET);} catch (UnsupportedEncodingException e) {throw new RuntimeException(e);}
			sb.append(key).append("=").append(value);
		}
		return sb.toString();
	}
723710
private String getParameterString(Entry<String, String> parameter) {

        return parameter.getKey() + "=" + parameter.getValue();
    }