public abstract class CollectionUtils extends Object
| Constructor and Description |
|---|
CollectionUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <T> Collection<T> |
addIgnoreNull(Collection<T> items,
T item) |
static <T> List<T> |
clone(List<T> list)
Creates a clone of the specified list (NOT a DEEP CLONE of the objects inside the list)
|
static <K,V> void |
cloneValuesInto(Map<K,V> fromMap,
Map<K,V> intoMap) |
static <T> List<T> |
copyAndFillWith(List<T> list,
int newSize,
T fillValue) |
static <T> List<T> |
copyAndFillWithNulls(List<T> list,
int newSize) |
static <T extends DeepComparable> |
deepEquals(Collection<T> coll1,
Collection<T> coll2) |
static <T extends DeepComparable> |
deepEquals(Collection<T> coll1,
Collection<T> coll2,
boolean ignoreId) |
static <T,C extends Collection<T>> |
filter(C collection,
Predicate<T> predicate) |
static <T> T |
find(Collection<T> items,
Predicate<T> predicate) |
static <T> T |
findItem(Collection<T> items,
Object key) |
static <T> T |
findItem(Collection<T> items,
Object key,
String keyPropertyName) |
static <T> List<Integer> |
indexOfItems(List<T> list,
Collection<T> items) |
static <T> Set<T> |
intersect(Collection<T> listA,
Collection<T> listB) |
static boolean |
isNotEmpty(Collection<?> collection) |
static <I,T> List<I> |
project(Collection<T> items,
String propertyName) |
static <T> void |
shiftItem(List<T> list,
T item,
int toIndex)
Shifts the item to the specified index.
|
static <T> List<T> |
sublistByIndexes(List<T> source,
List<Integer> indexes) |
static <T> Collection<T> |
unmodifiableCollection(Collection<? extends T> collection) |
static <T> List<T> |
unmodifiableList(List<? extends T> list)
Returns an unmodifiable view of the specified list.
|
static <K,V> Map<K,V> |
unmodifiableMap(Map<? extends K,? extends V> map) |
static <T> Set<T> |
unmodifiableSet(Set<? extends T> set) |
public static <T> List<T> unmodifiableList(List<? extends T> list)
list - Collections.unmodifiableListpublic static <T> Collection<T> unmodifiableCollection(Collection<? extends T> collection)
public static <T> void shiftItem(List<T> list, T item, int toIndex)
public static boolean isNotEmpty(Collection<?> collection)
public static <T,C extends Collection<T>> void filter(C collection, Predicate<T> predicate)
public static <T> T find(Collection<T> items, Predicate<T> predicate)
public static <T> T findItem(Collection<T> items, Object key)
public static <T> T findItem(Collection<T> items, Object key, String keyPropertyName)
public static <T> Collection<T> addIgnoreNull(Collection<T> items, T item)
public static <I,T> List<I> project(Collection<T> items, String propertyName)
public static <T extends DeepComparable> boolean deepEquals(Collection<T> coll1, Collection<T> coll2)
public static <T extends DeepComparable> boolean deepEquals(Collection<T> coll1, Collection<T> coll2, boolean ignoreId)
public static <T> List<T> clone(List<T> list)
list - public static <T> Set<T> intersect(Collection<T> listA, Collection<T> listB)
public static <T> List<Integer> indexOfItems(List<T> list, Collection<T> items)
Copyright © 2020 Open Foris. All rights reserved.