集合判空
import org.springframework.util.CollectionUtils;
CollectionUtils.isEmpty(list)
字符串判空
StringUtils.isEmpty("")
public static boolean isEmpty(String input)
{
if(input == null || input.length() == 0 || input.equalsIgnoreCase(EMPTY))
{
return true;
}
return false;
}
非字符串判空
import org.springframework.util.ObjectUtils;
ObjectUtils.isEmpty(fansId)