package com.qs.serve.common.util; import lombok.experimental.UtilityClass; /** * @author YenHex * @since 2022/2/28 */ @UtilityClass public class StringUtils extends org.springframework.util.StringUtils { /** 非空 */ public static boolean isNotEmpty(String str){ return !isEmpty(str); } /** 含有空对象 */ public static boolean hasEmpty(Object... strings){ for (Object str : strings) { if(isEmpty(str)){return true;} } return false; } /** * 格式化 * @param exp 含{}的表达式 * @param params 参数(注意跳过空值) * @return */ public static String format(String exp,String... params){ StringBuilder builder = new StringBuilder(exp); int idx_p = 0; while (hasText(builder,"{}")){ int idx = builder.indexOf("{}"); if(idx_p