Class CollKit
java.lang.Object
com.iohao.net.common.kit.CollKit
Collection manipulation utilities.
- Author:
- 渔民小镇
- date:
- 2022-01-14
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisEmpty(Collection<?> collection) Check whether the collection isnullor empty.booleannotEmpty(Collection<?> collection) Check whether the collection is notnulland not empty.<K,V> Map <K, V> Create a newConcurrentHashMap.<T> Set<T> Create a new concurrentSetbacked by aConcurrentHashMap.
-
Constructor Details
-
CollKit
public CollKit()
-
-
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
-