MCPcopy Create free account
hub / github.com/EhsanTang/ApiManager / getMap

Method getMap

api/src/main/java/cn/crap/utils/Tools.java:270–281  ·  view source on GitHub ↗

构造查询Map集合 @param params 不定数量参数 格式(key1,value1,key2,value2....) @return

(Object... params)

Source from the content-addressed store, hash-verified

268 * @return
269 */
270 public static Map<String, Object> getMap(Object... params) {
271 if (params.length == 0 || params.length % 2 != 0) {
272 return null;
273 }
274 Map<String, Object> map = new HashMap<String, Object>();
275 for (int i = 0; i < params.length; i = i + 2) {
276 if (!MyString.isEmpty(params[i + 1]))
277 map.put(params[i].toString(), params[i + 1]);
278 }
279 return map;
280
281 }
282
283 public static Map<String, String> getStrMap(String... params) {
284 if (params.length == 0 || params.length % 2 != 0) {

Callers 15

v6ToV7Method · 0.95
findPwdSendEmailMethod · 0.95
resetMethod · 0.95
registerMethod · 0.95
JsonResultMethod · 0.95
listMethod · 0.95
deleteMethod · 0.95
listMethod · 0.95
listMethod · 0.95
addOrUpdateMethod · 0.95
listMethod · 0.95
listMethod · 0.95

Calls 2

isEmptyMethod · 0.95
putMethod · 0.80

Tested by 1

v6ToV7Method · 0.76