List of utility methods to do URL Build
String | buildQuery(final Map Turns the specified Map into an encoded & escaped query if (query == null) { return ""; final StringBuilder builder = new StringBuilder(); for (final Map.Entry<String, Object> entry : query.entrySet()) { if (builder.length() > 0) { builder.append('&'); try { builder.append(URLEncoder.encode(entry.getKey(), "UTF-8")); } catch (final UnsupportedEncodingException e) { if (entry.getValue() != null) { builder.append('='); try { builder.append(URLEncoder.encode(entry.getValue().toString(), "UTF-8")); } catch (final UnsupportedEncodingException e) { return builder.toString(); |
String | buildQuery(final Map build Query if ((query == null) || query.isEmpty()) { return ""; return query.entrySet().stream() .map(entry -> createQueryElement(entry.getKey(), (entry.getValue() == null) ? null : entry.getValue().toString())) .reduce((s1, s2) -> s1 + "&" + s2).orElse(""); |
String | buildQuery(Map build Query StringBuilder localStringBuilder = new StringBuilder(); for (Map.Entry<String, Object> localEntry : paramMap.entrySet()) { if (localStringBuilder.length() > 0) { localStringBuilder.append('&'); try { localStringBuilder.append(URLEncoder.encode((String) localEntry.getKey(), "UTF-8")); } catch (UnsupportedEncodingException localUnsupportedEncodingException1) { ... |
String | buildQuery(Map build valid http request querystrings from a hashmap that contains name value pairs Copied from Play Router class TODO: array support StringBuilder queryString = new StringBuilder(); for (Map.Entry<String, Object> entry : paramMap.entrySet()) { String key = entry.getKey(); Object value = entry.getValue(); if (value != null) { if (List.class.isAssignableFrom(value.getClass())) { List<Object> vals = (List<Object>) value; for (Object e : vals) { ... |
String | buildQuery(Map build Query if (query == null) { return ""; } else { StringBuilder builder = new StringBuilder(); Iterator<Entry<String, Object>> it = query.entrySet().iterator(); while (it.hasNext()) { Entry<String, Object> entry = it.next(); if (builder.length() > 0) { ... |
String | buildQuery(Map build Query StringBuilder sb = new StringBuilder(); boolean first = true; for (Map.Entry<String, String> param : params.entrySet()) { if (!first) { sb.append("&"); sb.append(URLEncoder.encode(param.getKey(), "UTF-8")).append("=") .append(URLEncoder.encode(param.getValue(), "UTF-8")); ... |
String | buildQueryString(Map parameters) Builds a query string from the provided key-value-pairs. StringBuffer queryString = new StringBuffer(20 * parameters.size()); for (Iterator it = parameters.entrySet().iterator(); it.hasNext();) { Map.Entry parameter = (Map.Entry) it.next(); queryString.append(URLEncoder.encode((String) parameter.getKey(), "UTF-8")); queryString.append('='); queryString.append(URLEncoder.encode(String.valueOf(parameter.getValue()), "UTF-8")); if (it.hasNext()) queryString.append('&'); ... |
String | buildQueryString(Map Creates a query string out of parameters map StringBuilder sb = new StringBuilder(); Iterator<Map.Entry<String, Object>> entries = params.entrySet().iterator(); while (entries.hasNext()) { Map.Entry<String, Object> e = entries.next(); if (sb.length() > 0) { sb.append('&'); sb.append(URLEncoder.encode((String) e.getKey(), "UTF-8")).append('=') ... |
String | buildQueryString(Map Builds a URI query string from a map of keys and values. StringBuffer buf = new StringBuffer(); boolean firstParam = true; try { for (Map.Entry<String, Object> entry : queryParams.entrySet()) { if (entry.getValue() == null) continue; if (entry.getValue() instanceof List<?>) { List<?> values = (List<?>) entry.getValue(); ... |
String | buildQueryString(Map build Query String String qs = ""; if (params == null) return qs; int i = 0; for (String param : params.keySet()) { qs += param + "=" + URLEncoder.encode(params.get(param), "UTF-8") + (i++ < (params.size() - 1) ? "&" : ""); return qs; |