concate query string parameters (e.g. name=foo)

@param parameters query parameters
@return concatenated query string
@throws UnsupportedEncodingException exceptions
353154
public String concatQueryString(Map<String, String> parameters)
        throws UnsupportedEncodingException {
        if (null == parameters) {
            return null;
        }

        StringBuilder urlBuilder = new StringBuilder("");
        for (Map.Entry<String, String> entry : parameters.entrySet()) {
            String key = entry.getKey();
            String val = entry.getValue();
            urlBuilder.append(encode(key));
            if (val != null) {
                urlBuilder.append("=").append(encode(val));
            }
            urlBuilder.append("&");
        }

        int strIndex = urlBuilder.length();
        if (parameters.size() > 0) {
            urlBuilder.deleteCharAt(strIndex - 1);
        }

        return urlBuilder.toString();
    }
793242
private StringBuilder queryProcessing(TmdbParameters params) {
        StringBuilder urlString = new StringBuilder();

        // Append the suffix of the API URL
        if (submethod != MethodSub.NONE) {
            urlString.append("/").append(submethod.getValue());
        }

        // Append the key information
        urlString.append(DELIMITER_FIRST)
                .append(Param.API_KEY.getValue())
                .append(apiKey)
                .append(DELIMITER_SUBSEQUENT)// Append the search term
                .append(Param.QUERY.getValue());

        String query = (String) params.get(Param.QUERY);

        try {
            urlString.append(URLEncoder.encode(query, "UTF-8"));
        } catch (UnsupportedEncodingException ex) {
            LOG.trace("Unable to encode query: '{}' trying raw.", query, ex);
            // If we can't encode it, try it raw
            urlString.append(query);
        }

        return urlString;
    }
1372924
public static void validateBindParametersTypes(Parameters parameters) {
		final Iterator<Parameter> it = parameters.iterator();

		while (it.hasNext()) {
			final Parameter param = it.next();
			final Class<?> paramType = param.getType();

			if (!(param.isSpecialParameter() || SupportedCoreTypes
					.isSupported(paramType))) {
				throw (new IllegalArgumentException("Type " + paramType
						+ " not supported as an annotated query parameter!"));
			}
		}
	}
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();
	}
658449
public static String addParams(String href, HttpParameters params, String encoding) throws UnsupportedEncodingException {
		if(params!=null) {
			StringBuilder sb = new StringBuilder(href);
			// First find any anchor and if has parameters
			int anchorStart = href.lastIndexOf('#');
			String anchor;
			boolean hasQuestion;
			if(anchorStart == -1) {
				anchor = null;
				hasQuestion = href.lastIndexOf('?') != -1;
			} else {
				anchor = href.substring(anchorStart);
				sb.setLength(anchorStart);
				hasQuestion = href.lastIndexOf('?', anchorStart-1) != -1;
			}
			for(Map.Entry<String,List<String>> entry : params.getParameterMap().entrySet()) {
				String encodedName = URLEncoder.encode(entry.getKey(), encoding);
				for(String value : entry.getValue()) {
					if(hasQuestion) sb.append('&');
					else {
						sb.append('?');
						hasQuestion = true;
					}
					sb.append(encodedName);
					assert value!=null : "null values no longer supported to be consistent with servlet environment";
					sb.append('=').append(URLEncoder.encode(value, encoding));
				}
			}
			if(anchor!=null) sb.append(anchor);
			href = sb.toString();
		}
		return href;
	}
1136535
public void addParameters(NameValuePair[] parameters) {
        log.trace("enter PostMethod.addParameters(NameValuePair[])");

        if (parameters == null) {
            log.warn("Attempt to addParameters(null) ignored");
        } else {
            super.clearRequestBody();
            for (int i = 0; i < parameters.length; i++) {
                this.params.add(parameters[i]);
            }
        }
    }
731434
public QueryParameterWrap addParameters(String name, Object[] values) {
		this.namedParameter.put(name, values);
		return this;
	}
648622
public static List<HttpParameter> decodeParameters(String queryParameters) {
        List<HttpParameter> result=new ArrayList<HttpParameter>();
        for (String pair : queryParameters.split("&")) {
            String[] parts=pair.split("=", 2);
            if(parts.length == 2) {
                String name=decode(parts[0]);
                String value=decode(parts[1]);
                if(!name.equals("") && !value.equals(""))
                    result.add(new HttpParameter(name, value));
            }
        }
        return result;
    }
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 ();
            }
        }
364822
public Sql getSQLByNameWithParameters(String name, Object parameters) {
		if (name == null) {
			return null;
		}

		Map<String, Object> parameterMap = buildParameters(parameters);

		SqlObject sqlObj = this.sqlMap.get(name);
		if (sqlObj != null) {

			if (sqlObj.isPrepare() == false || (this.varMap.containsKey("prepare") == false && "false".equalsIgnoreCase(this.varMap.get("prepare")))) {
				String sql = replaceSQL(sqlObj, parameterMap);
				return new Sql(sql, parameterMap);
			} else {
				String sql = replaceChoose(sqlObj, parameterMap);
				if (sqlObj instanceof ProcedureObject) {
					ProcedureObject procedureObj = (ProcedureObject)sqlObj;
					List<Out> outList = procedureObj.getOut();
					for (Out out : outList) {
						parameterMap.put(out.getName(), out);
					}
				}
				return getPreperSQLWithParameters(sql, parameterMap);
			}
		} else {
			return null;
		}
	}
402757
static void addQueryParams(Set<Entry<String, Object>> entrySet, StringBuilder buf) {
    // (similar to UrlEncodedContent)
    boolean first = true;
    for (Map.Entry<String, Object> nameValueEntry : entrySet) {
      Object value = nameValueEntry.getValue();
      if (value != null) {
        String name = CharEscapers.escapeUriQuery(nameValueEntry.getKey());
        if (value instanceof Collection<?>) {
          Collection<?> collectionValue = (Collection<?>) value;
          for (Object repeatedValue : collectionValue) {
            first = appendParam(first, buf, name, repeatedValue);
          }
        } else {
          first = appendParam(first, buf, name, value);
        }
      }
    }
  }
656592
protected static List<String> formatMessageParameters(Object[] parameters) {
        List<String> arguments = new ArrayList<>(parameters.length);
        for (Object argument : parameters) {
            arguments.add((argument != null) ? argument.toString() : null);
        }
        return arguments;
    }
13854
public static String[] extractParameterMultiple(String name, Map parameters) {
		String paramValues = extractParameter(name, parameters);
		return StringUtils.stripAll(StringUtils.split(paramValues, ", "));
	}
1313796
@Override
	public void configure(Configuration parameters) {
		super.configure(parameters);

		if (charsetName == null || !Charset.isSupported(charsetName)) {
			throw new RuntimeException("Unsupported charset: " + charsetName);
		}

		if (charsetName.equalsIgnoreCase(StandardCharsets.US_ASCII.name())) {
			ascii = true;
		}

		this.decoder = Charset.forName(charsetName).newDecoder();
		this.byteWrapper = ByteBuffer.allocate(1);
	}
186896
public void addParameters(Map<String, Object> parameters, boolean suppressNull) {
        
        for (String name : parameters.keySet()) {
            Object value = parameters.get(name);
            
            if (!suppressNull || value != null) {
                addParameter(name, value);
            }
        }
    }
577526
public UriComponentsBuilder queryParams(MultiValueMap<String, String> params) {
		Assert.notNull(params, "'params' must not be null");
		this.queryParams.putAll(params);
		return this;
	}
849406
private void fillParams(final Map<String, String[]> params, final String queryString, Charset charset) {
        if (StringUtils.hasText(queryString)) {
            final StringTokenizer tokenizer = new StringTokenizer(queryString, "&");
            while (tokenizer.hasMoreTokens()) {
                final String[] nameValuePair = tokenizer.nextToken().split("=");

                try {
                    params.put(URLDecoder.decode(nameValuePair[0], charset.name()),
                            new String[] { URLDecoder.decode(nameValuePair[1], charset.name()) });
                } catch (final UnsupportedEncodingException e) {
                    throw new CitrusRuntimeException(String.format(
                            "Failed to decode query param value '%s=%s'",
                            nameValuePair[0],
                            nameValuePair[1]), e);
                }
            }
        }
    }