CacheUtil.java
707 Bytes
package cn.com.glsx.wechatbuild.util;
import java.util.Arrays;
import java.util.stream.Collectors;
import org.apache.dubbo.common.utils.ArrayUtils;
/**
* @Title: CacheUtil.java
* @Description:
* @author Alvin
* @date 2020年10月20日 下午6:52:24
* @version V1.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2020
*/
public class CacheUtil {
public final static String SEPARATOR_COLON = ":";
public static String getCacheKey(String prefix, String...keys){
String cacheKey = prefix;
if(ArrayUtils.isNotEmpty(keys)){
cacheKey = cacheKey.concat(SEPARATOR_COLON).concat(Arrays.asList(keys).stream().collect(Collectors.joining(SEPARATOR_COLON)));
}
return cacheKey;
}
}