Package com.exasol.adapter
Class CollectionUtils
- java.lang.Object
-
- com.exasol.adapter.CollectionUtils
-
public final class CollectionUtils extends Object
Utilities for working with collections.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> List<T>copyOfOrEmpty(List<T> values)Create an unmodifiable copy of a list or return an empty list if the input isnull.static <K,V>
Map<K,V>copyOfOrEmpty(Map<K,V> values)Create an unmodifiable copy of a map or return an empty map if the input isnull.
-
-
-
Method Detail
-
copyOfOrEmpty
public static <T> List<T> copyOfOrEmpty(List<T> values)
Create an unmodifiable copy of a list or return an empty list if the input isnull. List elements may benull.- Type Parameters:
T- element type- Parameters:
values- source list- Returns:
- unmodifiable list copy or empty list
-
copyOfOrEmpty
public static <K,V> Map<K,V> copyOfOrEmpty(Map<K,V> values)
Create an unmodifiable copy of a map or return an empty map if the input isnull. Map keys and values may benull.Preserves the iteration order of the input map.
- Type Parameters:
K- key typeV- value type- Parameters:
values- source map- Returns:
- unmodifiable map copy or empty map
-
-