public class CollectionUtils extends Object
| Constructor and Description |
|---|
CollectionUtils() |
| Modifier and Type | Method and Description |
|---|---|
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 |
findItem(Collection<T> items,
Object key) |
static <T> T |
findItem(Collection<T> items,
Object key,
String keyPropertyName) |
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> 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 <T,C extends Collection<T>> void filter(C collection, 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 <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 - Copyright © 2020 Open Foris. All rights reserved.