类 CollectUtils
java.lang.Object
org.springframework.util.CollectionUtils
com.cdkjframework.util.tool.CollectUtils
public class CollectUtils
extends org.springframework.util.CollectionUtils
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static <K,
V> V computeIfAbsent
(Map<K, V> concurrentHashMap, K key, Function<? super K, ? extends V> mappingFunction) 用来过渡下Jdk1.8下ConcurrentHashMap的性能bugstatic boolean
是否为空static boolean
isNotEmpty
(Object[] array) 是否非空static boolean
isNotEmpty
(Collection<?> collection) 是否非空static boolean
isNotEmpty
(Map<?, ?> map) 是否非空static <K,
V> HashMap<K, V> newHashMapWithExpectedSize
(int expectedSize) 根据预期大小创建HashMap.split
(Collection<T> entityList, int batchSize) 切割集合为多个集合static <T> List<T>
toList
(T... t) 构建 List从类继承的方法 org.springframework.util.CollectionUtils
arrayToList, contains, contains, containsAny, containsInstance, findCommonElementType, findFirstMatch, findValueOfType, findValueOfType, firstElement, firstElement, hasUniqueObject, isEmpty, isEmpty, lastElement, lastElement, mergeArrayIntoCollection, mergePropertiesIntoMap, newHashMap, newLinkedHashMap, toArray, toIterator, toMultiValueMap, unmodifiableMultiValueMap
-
构造器详细资料
-
CollectUtils
public CollectUtils()
-
-
方法详细资料
-
isEmpty
是否为空- 参数:
array
- 集合- 返回:
- 返回是否
-
isNotEmpty
是否非空- 参数:
array
- 集合- 返回:
- 返回是否
-
isNotEmpty
是否非空- 参数:
collection
- 集合- 返回:
- 返回是否
-
isNotEmpty
是否非空- 参数:
map
- 集合- 返回:
- 返回是否
-
toList
构建 List -
newHashMapWithExpectedSize
根据预期大小创建HashMap.- 类型参数:
K
- KV
- V- 参数:
expectedSize
- 预期大小- 返回:
- HashMap
- 另请参阅:
-
Maps.newHashMapWithExpectedSize(int)
-
computeIfAbsent
public static <K,V> V computeIfAbsent(Map<K, V> concurrentHashMap, K key, Function<? super K, ? extends V> mappingFunction) 用来过渡下Jdk1.8下ConcurrentHashMap的性能bugA temporary workaround for Java 8 ConcurrentHashMap#computeIfAbsent specific performance issue: JDK-8161372.
- 类型参数:
K
- kV
- v- 参数:
concurrentHashMap
- ConcurrentHashMap 没限制类型了,非ConcurrentHashMap就别调用这方法了key
- keymappingFunction
- function- 返回:
- V
-
split
切割集合为多个集合- 类型参数:
T
- 数据类型- 参数:
entityList
- 数据集合batchSize
- 每批集合的大小- 返回:
- 切割后的多个集合
-