MCPcopy Index your code
hub / github.com/ccxt/ccxt / implodeParams

Method implodeParams

java/lib/src/main/java/io/github/ccxt/base/Misc.java:92–129  ·  view source on GitHub ↗
(Object path2, Object parameter2)

Source from the content-addressed store, hash-verified

90 }
91
92 public static Object implodeParams(Object path2, Object parameter2) {
93
94 String path = (String) path2;
95
96 if (!(parameter2 instanceof List)) {
97
98 if (!(parameter2 instanceof Map)) {
99 throw new IllegalArgumentException("parameter2 must be Map<String, Object> or List<Object>");
100 }
101
102 @SuppressWarnings("unchecked")
103 Map<String, Object> parameter = (Map<String, Object>) parameter2;
104
105 // var keys = new List<string>(((dict)parameter).Keys);
106 // We just iterate map entries in Java
107 // var outList = new List<object>(); // (not actually used)
108 for (Map.Entry<String, Object> entry : parameter.entrySet()) {
109 String key = entry.getKey();
110 Object value = entry.getValue();
111
112 if (value == null) {
113 continue;
114 }
115
116 // if (value.GetType() != typeof(List<object>))
117 if (!(value instanceof List)) {
118 // path = path.Replace("{"+key+"}", Convert.ToString(value));
119 String replacement = String.valueOf(value);
120 path = path.replace("{" + key + "}", replacement);
121 }
122 }
123
124 return path;
125
126 } else {
127 return (String) path2;
128 }
129 }
130}

Callers 15

implodeParamsMethod · 0.95
signMethod · 0.45
signMethod · 0.45
signMethod · 0.45
signMethod · 0.45
signMethod · 0.45
signMethod · 0.45
signMethod · 0.45
signMethod · 0.45
signMethod · 0.45
signMethod · 0.45
signMethod · 0.45

Calls 2

replaceMethod · 0.80
getValueMethod · 0.45

Tested by

no test coverage detected