public class CollectionUtil
extends java.lang.Object
| Constructor and Description |
|---|
CollectionUtil() |
| Modifier and Type | Method and Description |
|---|---|
static <T> java.util.List<T> |
immutableList(java.util.List<T> l)
Make an unmodifiable shallow copy of the argument.
|
static <T> java.util.List<T> |
immutableListOrEmpty(java.util.List<T> l)
Alias of
s == null ? Collections.emptyList() : CollectionUtil.immutableList(s). |
static <K,V> java.util.Map<K,V> |
immutableMap(java.util.Map<K,V> m)
Make an unmodifiable shallow copy of the argument.
|
static <T> java.util.Set<T> |
immutableSet(java.util.Set<T> s)
Make an unmodifiable shallow copy of the argument.
|
static <T> java.util.Set<T> |
immutableSetOrEmpty(java.util.Set<T> s)
Alias of
s == null ? Collections.emptySet() : CollectionUtil.immutableSet(s). |
static <T> java.util.SortedSet<T> |
immutableSortedSet(java.util.Set<T> s)
Make an unmodifiable shallow copy of the argument.
|
public static <K,V> java.util.Map<K,V> immutableMap(java.util.Map<K,V> m)
m which cannot be modifiedpublic static <T> java.util.List<T> immutableList(java.util.List<T> l)
l which cannot be modifiedpublic static <T> java.util.List<T> immutableListOrEmpty(java.util.List<T> l)
s == null ? Collections.emptyList() : CollectionUtil.immutableList(s).public static <T> java.util.Set<T> immutableSet(java.util.Set<T> s)
s which cannot be modifiedpublic static <T> java.util.Set<T> immutableSetOrEmpty(java.util.Set<T> s)
s == null ? Collections.emptySet() : CollectionUtil.immutableSet(s).public static <T> java.util.SortedSet<T> immutableSortedSet(java.util.Set<T> s)
s which cannot be modified