MCPcopy Index your code
hub / github.com/amadeus4dev/amadeus-java / toQueryString

Method toQueryString

src/main/java/com/amadeus/Params.java:62–81  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

60
61 // Converts params into a HTTP query string.
62 protected String toQueryString() {
63 StringBuilder query = new StringBuilder();
64 boolean first = true;
65 for (Map.Entry<String, String> entry : entrySet()) {
66 if (!first) {
67 query.append("&");
68 }
69 first = false;
70 try {
71 query.append(URLEncoder.encode(entry.getKey(), encoding));
72 query.append("=");
73 query.append(URLEncoder.encode(entry.getValue(), encoding));
74 } catch (UnsupportedEncodingException e) {
75 Logger logger = Logger.getLogger(getClass().getName());
76 logger.log(Level.WARNING, "Exception while encoding the query string", e);
77 }
78 }
79
80 return query.toString();
81 }
82
83 /**
84 * Converts params into a HTTP query string.

Callers 6

testToQueryStringMethod · 0.95
toStringMethod · 0.95
getQueryParamsMethod · 0.80
writeMethod · 0.80

Calls 2

toStringMethod · 0.80
logMethod · 0.45

Tested by 3

testToQueryStringMethod · 0.76