Package org.spongepowered.api.util
Class CollectionUtils
java.lang.Object
org.spongepowered.api.util.CollectionUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> List<T>
Attempts to use nativeObject.clone()
methods on available map types.static <K,
V> Map<K, V> Attempts to use nativeObject.clone()
methods on available map types.
-
Method Details
-
copyMap
Attempts to use nativeObject.clone()
methods on available map types. If a map cannot be properly cloned, a newHashMap
is returned.- Type Parameters:
K
- The key typeV
- The value type- Parameters:
map
- The map input- Returns:
- A copied map
-
copyList
Attempts to use nativeObject.clone()
methods on available map types. If a list cannot be properly cloned, a newArrayList
is returned.- Type Parameters:
T
- The value type- Parameters:
list
- The list input- Returns:
- A copied list
-