io.gitee.huangguiming.Imcode.utils.DataUtils Maven / Gradle / Ivy
package io.gitee.huangguiming.Imcode.utils;
import org.apache.commons.lang3.RegExUtils;
import org.apache.commons.lang3.StringUtils;
public class DataUtils {
public static E handleDataWithSecret(E data) {
E dataForLog = data;
if(data instanceof String && StringUtils.contains((String)data, "&secret=")){
dataForLog = (E) RegExUtils.replaceAll((String)data,"&secret=\\w+&","&secret=******&");
}
return dataForLog;
}
}