com.cmonbaby.http.utils.ParamsUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of http_lower Show documentation
Show all versions of http_lower Show documentation
Android Http Core Library
package com.cmonbaby.http.utils;
import java.util.HashMap;
import java.util.Map;
/**
* Author: Simon
*
QO: 8950764
*
Email: [email protected]
*
WebSize: https://www.cmonbaby.com
*
Version: 1.0.0
*
Date: 2020/12/28
*
Description: 参数校验
*/
public class ParamsUtils {
/**
* retrofit的params的值不能为null,此处做下校验,防止出错
*
* @param params 需检查的参数集合
*/
public static Map checkParams(Map params) {
if (params == null) {
params = new HashMap<>();
}
for (Map.Entry entry : params.entrySet()) {
if (entry.getValue() == null) {
params.put(entry.getKey(), "");
}
}
return params;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy