Package com.yubico.internal.util
Class CollectionUtil
- java.lang.Object
-
- com.yubico.internal.util.CollectionUtil
-
public class CollectionUtil extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description CollectionUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method 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 ofs == 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 ofs == 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.
-
-
-
Method Detail
-
immutableMap
public static <K,V> java.util.Map<K,V> immutableMap(java.util.Map<K,V> m)
Make an unmodifiable shallow copy of the argument.- Returns:
- A shallow copy of
mwhich cannot be modified
-
immutableList
public static <T> java.util.List<T> immutableList(java.util.List<T> l)
Make an unmodifiable shallow copy of the argument.- Returns:
- A shallow copy of
lwhich cannot be modified
-
immutableListOrEmpty
public static <T> java.util.List<T> immutableListOrEmpty(java.util.List<T> l)
Alias ofs == null ? Collections.emptyList() : CollectionUtil.immutableList(s).
-
immutableSet
public static <T> java.util.Set<T> immutableSet(java.util.Set<T> s)
Make an unmodifiable shallow copy of the argument.- Returns:
- A shallow copy of
swhich cannot be modified
-
immutableSetOrEmpty
public static <T> java.util.Set<T> immutableSetOrEmpty(java.util.Set<T> s)
Alias ofs == null ? Collections.emptySet() : CollectionUtil.immutableSet(s).
-
immutableSortedSet
public static <T> java.util.SortedSet<T> immutableSortedSet(java.util.Set<T> s)
Make an unmodifiable shallow copy of the argument.- Returns:
- A shallow copy of
swhich cannot be modified
-
-