Package com.pugwoo.dbhelper.utils
Class InnerCommonUtils
java.lang.Object
com.pugwoo.dbhelper.utils.InnerCommonUtils
内部常用工具类
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]decodeBase64(String str) static StringencodeBase64(byte[] bytes) static <T> List<T> filter(Collection<T> list, Predicate<? super T> predicate) filter一个liststatic <T> List<T> filter一个数组static <T> Collection<T> filterNonNull(Collection<T> list) static Stringstatic booleanstatic booleanisContains(String checkStr, String[] strings) 检查strings中是否包含有checkStr字符串static booleanisEmpty(Collection<?> collection) static booleanisNotBlank(String str) static booleanisNotEmpty(String[] strings) 判断给定的数组是否非空static booleanisNotEmpty(Collection<?> collection) static String读取classpath目录下的资源,返回为String,默认是utf-8编码。 如果需要其它编码,请获得byte[]之后自行转换。 说明:当有多个同名的资源时,会返回第一个加载到jvm的资源内容,因此这里具有随机性。将字符串str按间隔符sep分隔,返回分隔后的字符串
-
Constructor Details
-
InnerCommonUtils
public InnerCommonUtils()
-
-
Method Details
-
isBlank
-
isNotBlank
-
isEmpty
-
isNotEmpty
-
filterNonNull
-
filter
filter一个list -
filter
filter一个数组 -
partition
-
isNotEmpty
判断给定的数组是否非空 -
isContains
检查strings中是否包含有checkStr字符串 -
split
将字符串str按间隔符sep分隔,返回分隔后的字符串- Parameters:
str- 字符串sep- 间隔符- Returns:
- 会自动过滤掉空白(blank)的字符串;并且会自动trim()
-
firstLetterUpperCase
-
readClasspathResourceAsString
读取classpath目录下的资源,返回为String,默认是utf-8编码。 如果需要其它编码,请获得byte[]之后自行转换。 说明:当有多个同名的资源时,会返回第一个加载到jvm的资源内容,因此这里具有随机性。- Parameters:
path- 路径,例如:abc.txt- Returns:
- 文件不存在返回null
-
encodeBase64
-
decodeBase64
-