All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.cmonbaby.http.utils.ParamsUtils Maven / Gradle / Ivy

There is a newer version: 2.0.2
Show newest version
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