Package com.gigaspaces.internal.utils
Class CollectionUtils
java.lang.Object
com.gigaspaces.internal.utils.CollectionUtils
Miscellaneous collection utility methods. Mainly for internal use within the framework.
- Author:
- kimchy
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Collection<T>cloneCollection(Collection<T> collection) static <T> List<T>static <K,V> Map<K, V> static <T> booleanequals(Collection<T> c1, Collection<T> c2) static <T> Tfirst(Collection<T> collection) static booleanisEmpty(Collection<?> collection) Returntrueif the suppliedCollectionis null or empty.static <T> List<T>toList(T... items) Converts the supplied array into a List.static <T> Set<T>toSet(T... items) Converts the supplied array into a Set.static <T> java.util.stream.Stream<T>toStream(Collection<T> collection) static <T> List<T>toUnmodifiableList(T... items) static <T> Set<T>toUnmodifiableSet(T... items)
-
Constructor Details
-
CollectionUtils
public CollectionUtils()
-
-
Method Details
-
isEmpty
Returntrueif the suppliedCollectionis null or empty. Otherwise, returnfalse.- Parameters:
collection- theCollectionto check
-
toStream
-
toList
Converts the supplied array into a List.- Parameters:
source- the original array- Returns:
- the converted List result
-
toUnmodifiableList
-
toSet
Converts the supplied array into a Set.- Parameters:
source- the original array- Returns:
- the converted List result
-
toUnmodifiableSet
-
equals
-
cloneList
-
cloneCollection
-
cloneMap
-
first
-