Class CollKit
java.lang.Object
com.iohao.net.common.kit.CollKit
Collection manipulation utilities.
- Author:
- 渔民小镇
- date:
- 2022-01-14
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisEmpty(Collection<?> collection) Check whether the collection isnullor empty.static booleannotEmpty(Collection<?> collection) Check whether the collection is notnulland not empty.static <K,V> Map <K, V> Create a newConcurrentHashMap.static <T> Set<T> Create a new concurrentSetbacked by aConcurrentHashMap.
-
Method Details
-
notEmpty
Check whether the collection is notnulland not empty.- Parameters:
collection- the collection to check- Returns:
trueif the collection contains at least one element
-
isEmpty
Check whether the collection isnullor empty.- Parameters:
collection- the collection to check- Returns:
trueif the collection isnullor contains no elements
-
ofConcurrentSet
Create a new concurrentSetbacked by aConcurrentHashMap.- Type Parameters:
T- the element type- Returns:
- a new thread-safe set
-
ofConcurrentHashMap
Create a newConcurrentHashMap.- Type Parameters:
K- the key typeV- the value type- Returns:
- a new thread-safe map
-