forked from neurodock/NeuroDock
refactor: me.zacharias.chat → me.neurodock, org rename cleanup
- Renamed package from me.zacharias.chat to me.neurodock across all 8 modules - Updated Gradle group from me.zacharias.neurodock to me.neurodock - Updated README and other files to reflect new Gitea org URL (Chat_things → neurodock) Dev note: 95 files touched. The Great Refactor is complete, long may it rest.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package me.neurodock.genius;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Map;
|
||||
|
||||
public class ParameterStringBuilder {
|
||||
public static String getParamsString(Map<String, String> params)
|
||||
throws UnsupportedEncodingException {
|
||||
if(params == null)
|
||||
return "";
|
||||
StringBuilder result = new StringBuilder();
|
||||
|
||||
for (Map.Entry<String, String> entry : params.entrySet()) {
|
||||
result.append(URLEncoder.encode(entry.getKey(), StandardCharsets.UTF_8));
|
||||
result.append("=");
|
||||
result.append(URLEncoder.encode(entry.getValue(), StandardCharsets.UTF_8));
|
||||
result.append("&");
|
||||
}
|
||||
|
||||
String resultString = result.toString();
|
||||
return !resultString.isEmpty()
|
||||
? resultString.substring(0, resultString.length() - 1)
|
||||
: resultString;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user