public final class CollectionUtils extends Object
Modifier and Type | Method and Description |
---|---|
static <T> List<T> |
copyList(List<? extends T> list)
Attempts to use native
Object.clone() methods on available map
types. |
static <K,V> Map<K,V> |
copyMap(Map<? extends K,? extends V> map)
Attempts to use native
Object.clone() methods on available map
types. |
public static <K,V> Map<K,V> copyMap(Map<? extends K,? extends V> map)
Object.clone()
methods on available map
types. If a map cannot be properly cloned, a new HashMap
is
returned.K
- The key typeV
- The value typemap
- The map inputpublic static <T> List<T> copyList(List<? extends T> list)
Object.clone()
methods on available map
types. If a list cannot be properly cloned, a new ArrayList
is
returned.T
- The value typelist
- The list input