Class CollectionUtil

java.lang.Object
com.yubico.internal.util.CollectionUtil

public class CollectionUtil extends Object
  • Constructor Details

    • CollectionUtil

      public CollectionUtil()
  • Method Details

    • immutableMap

      public static <K, V> Map<K,V> immutableMap(Map<K,V> m)
      Make an unmodifiable shallow copy of the argument.
      Returns:
      A shallow copy of m which cannot be modified
    • immutableList

      public static <T> List<T> immutableList(List<T> l)
      Make an unmodifiable shallow copy of the argument.
      Returns:
      A shallow copy of l which cannot be modified
    • immutableListOrEmpty

      public static <T> List<T> immutableListOrEmpty(List<T> l)
      Alias of s == null ? Collections.emptyList() : CollectionUtil.immutableList(s).
    • immutableSet

      public static <T> Set<T> immutableSet(Set<T> s)
      Make an unmodifiable shallow copy of the argument.
      Returns:
      A shallow copy of s which cannot be modified
    • immutableSetOrEmpty

      public static <T> Set<T> immutableSetOrEmpty(Set<T> s)
      Alias of s == null ? Collections.emptySet() : CollectionUtil.immutableSet(s).
    • immutableSortedSet

      public static <T> SortedSet<T> immutableSortedSet(Set<T> s)
      Make an unmodifiable shallow copy of the argument.
      Returns:
      A shallow copy of s which cannot be modified