Class CollectionUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <D> List<D>Concatenates two lists into onestatic <T> Set<T>difference(Set<? extends T> a, Set<? extends T> b) Returns a difference of two setsstatic <T> Tstatic <T> Tstatic <T> booleanhasIntersection(Set<? extends T> a, Set<? extends T> b) static <T> Set<T>intersection(Set<? extends T> a, Set<? extends T> b) Returns an intersection of two setsstatic <T> Tstatic <T> Tstatic <K,V> HashMap<K, V> newHashMap(int initialSize) static <T> HashSet<T>newHashSet(int initialSize) static <K,V> LinkedHashMap<K, V> newLinkedHashMap(int initialSize) static <T> LinkedHashSet<T>newLinkedHashSet(int initialSize) static <T> Set<T>Returns a union of two sets
-
Constructor Details
-
CollectionUtils
public CollectionUtils()
-
-
Method Details
-
concat
Concatenates two lists into oneNo guarantee on a mutability of a resulting list is made, so list should be considered unmodifiable
If any of concatenated lists is modified, the behaviour of a concatenated list is undefined
- Throws:
NullPointerException- may be thrown if any list isnullor containsnullelements
-
difference
Returns a difference of two setsNo guarantee on a mutability of a resulting set is made, so set should be considered unmodifiable
If any of provided sets is modified, the behaviour of a resulting set is undefined
-
intersection
Returns an intersection of two setsNo guarantee on a mutability of a resulting set is made, so set should be considered unmodifiable
If any of provided sets is modified, the behaviour of a resulting set is undefined
-
hasIntersection
-
union
Returns a union of two setsNo guarantee on a mutability of a resulting set is made, so set should be considered unmodifiable
If any of provided sets is modified, the behaviour of a resulting set is undefined
-
first
-
first
-
last
-
last
-
newHashMap
-
newLinkedHashMap
-
newHashSet
-
newLinkedHashSet
-