Class Immutables

java.lang.Object
com.google.mu.collect.Immutables

@Deprecated @RequiresGuava public final class Immutables extends Object
Deprecated.
Please do not use it. It's only used internally.
Convenient factory methods of common immutable Guava data types that are concise yet unambiguous when static imported.

For example list(1, 2), map("key", "value"), multimap(k1, v1, k2, v2) etc.

These APIs are best static imported universally throughout a code base such that seeing list(1, 2), map(k, v) immediately tells the readers what they are. For new code base, collection literals like list(1, 2) are more concise than their longer equivalents like ImmutableList.of(1, 2). For existing code base, either fully migrate the longer literals or continue using them. Mixing the two styles can cause confusion.

Unlike JDK collection literals such as Map.of(), collection literals returned by this class don't lose the "Immutable" from the type. This allows you to use ImmutableMap, ImmutableList as return types of public API, helping to make the contract unambiguous. If you use Guava, we recommend continuing to use the immutable collection types and the immutable collection literals in this class over JDK collection literals.

Since:
6.0
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    static <K, V> com.google.common.collect.ImmutableBiMap<K,V>
    Deprecated.
    Returns the empty bimap.
    static <K, V> com.google.common.collect.ImmutableBiMap<K,V>
    biMap(K k1, V v1)
    Deprecated.
    Returns an immutable bimap containing a single entry.
    static <K, V> com.google.common.collect.ImmutableBiMap<K,V>
    biMap(K k1, V v1, K k2, V v2)
    Deprecated.
    Returns an immutable map containing the given entries, in order.
    static <K, V> com.google.common.collect.ImmutableBiMap<K,V>
    biMap(K k1, V v1, K k2, V v2, K k3, V v3)
    Deprecated.
    Returns an immutable map containing the given entries, in order.
    static <K, V> com.google.common.collect.ImmutableBiMap<K,V>
    biMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4)
    Deprecated.
    Returns an immutable map containing the given entries, in order.
    static <K, V> com.google.common.collect.ImmutableBiMap<K,V>
    biMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5)
    Deprecated.
    Returns an immutable map containing the given entries, in order.
    static <K, V> com.google.common.collect.ImmutableBiMap<K,V>
    biMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6)
    Deprecated.
    Returns an immutable map containing the given entries, in order.
    static <K, V> com.google.common.collect.ImmutableBiMap<K,V>
    biMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7)
    Deprecated.
    Returns an immutable map containing the given entries, in order.
    static <K, V> com.google.common.collect.ImmutableBiMap<K,V>
    biMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8)
    Deprecated.
    Returns an immutable map containing the given entries, in order.
    static <K, V> com.google.common.collect.ImmutableBiMap<K,V>
    biMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9)
    Deprecated.
    Returns an immutable map containing the given entries, in order.
    static <K, V> com.google.common.collect.ImmutableBiMap<K,V>
    biMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9, K k10, V v10)
    Deprecated.
    Returns an immutable map containing the given entries, in order.
    static <E> com.google.common.collect.ImmutableList<E>
    Deprecated.
    Returns the empty immutable list.
    static <E> com.google.common.collect.ImmutableList<E>
    list(E element)
    Deprecated.
    Returns an immutable list containing a single element.
    static <E> com.google.common.collect.ImmutableList<E>
    list(E e1, E e2)
    Deprecated.
    Returns an immutable list containing the given elements, in order.
    static <E> com.google.common.collect.ImmutableList<E>
    list(E e1, E e2, E e3)
    Deprecated.
    Returns an immutable list containing the given elements, in order.
    static <E> com.google.common.collect.ImmutableList<E>
    list(E e1, E e2, E e3, E e4)
    Deprecated.
    Returns an immutable list containing the given elements, in order.
    static <E> com.google.common.collect.ImmutableList<E>
    list(E e1, E e2, E e3, E e4, E e5)
    Deprecated.
    Returns an immutable list containing the given elements, in order.
    static <E> com.google.common.collect.ImmutableList<E>
    list(E e1, E e2, E e3, E e4, E e5, E e6)
    Deprecated.
    Returns an immutable list containing the given elements, in order.
    static <E> com.google.common.collect.ImmutableList<E>
    list(E e1, E e2, E e3, E e4, E e5, E e6, E e7)
    Deprecated.
    Returns an immutable list containing the given elements, in order.
    static <E> com.google.common.collect.ImmutableList<E>
    list(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8)
    Deprecated.
    Returns an immutable list containing the given elements, in order.
    static <E> com.google.common.collect.ImmutableList<E>
    list(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9)
    Deprecated.
    Returns an immutable list containing the given elements, in order.
    static <E> com.google.common.collect.ImmutableList<E>
    list(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9, E e10)
    Deprecated.
    Returns an immutable list containing the given elements, in order.
    static <E> com.google.common.collect.ImmutableList<E>
    list(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9, E e10, E e11)
    Deprecated.
    Returns an immutable list containing the given elements, in order.
    static <E> com.google.common.collect.ImmutableList<E>
    list(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9, E e10, E e11, E e12, E... others)
    Deprecated.
    Returns an immutable list containing the given elements, in order.
    static <K, V> com.google.common.collect.ImmutableMap<K,V>
    map()
    Deprecated.
    Returns the empty map.
    static <K, V> com.google.common.collect.ImmutableMap<K,V>
    map(K k1, V v1)
    Deprecated.
    Returns an immutable map containing a single entry.
    static <K, V> com.google.common.collect.ImmutableMap<K,V>
    map(K k1, V v1, K k2, V v2)
    Deprecated.
    Returns an immutable map containing the given entries, in order.
    static <K, V> com.google.common.collect.ImmutableMap<K,V>
    map(K k1, V v1, K k2, V v2, K k3, V v3)
    Deprecated.
    Returns an immutable map containing the given entries, in order.
    static <K, V> com.google.common.collect.ImmutableMap<K,V>
    map(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4)
    Deprecated.
    Returns an immutable map containing the given entries, in order.
    static <K, V> com.google.common.collect.ImmutableMap<K,V>
    map(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5)
    Deprecated.
    Returns an immutable map containing the given entries, in order.
    static <K, V> com.google.common.collect.ImmutableMap<K,V>
    map(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6)
    Deprecated.
    Returns an immutable map containing the given entries, in order.
    static <K, V> com.google.common.collect.ImmutableMap<K,V>
    map(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7)
    Deprecated.
    Returns an immutable map containing the given entries, in order.
    static <K, V> com.google.common.collect.ImmutableMap<K,V>
    map(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8)
    Deprecated.
    Returns an immutable map containing the given entries, in order.
    static <K, V> com.google.common.collect.ImmutableMap<K,V>
    map(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9)
    Deprecated.
    Returns an immutable map containing the given entries, in order.
    static <K, V> com.google.common.collect.ImmutableMap<K,V>
    map(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9, K k10, V v10)
    Deprecated.
    Returns an immutable map containing the given entries, in order.
    static <K, V> com.google.common.collect.ImmutableListMultimap<K,V>
    Deprecated.
    Returns the empty multimap.
    static <K, V> com.google.common.collect.ImmutableListMultimap<K,V>
    multimap(K k1, V v1)
    Deprecated.
    Returns an immutable multimap containing a single entry.
    static <K, V> com.google.common.collect.ImmutableListMultimap<K,V>
    multimap(K k1, V v1, K k2, V v2)
    Deprecated.
    Returns an immutable multimap containing the given entries, in order.
    static <K, V> com.google.common.collect.ImmutableListMultimap<K,V>
    multimap(K k1, V v1, K k2, V v2, K k3, V v3)
    Deprecated.
    Returns an immutable multimap containing the given entries, in order.
    static <K, V> com.google.common.collect.ImmutableListMultimap<K,V>
    multimap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4)
    Deprecated.
    Returns an immutable multimap containing the given entries, in order.
    static <K, V> com.google.common.collect.ImmutableListMultimap<K,V>
    multimap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5)
    Deprecated.
    Returns an immutable multimap containing the given entries, in order.
    static <E> com.google.common.collect.ImmutableMultiset<E>
    Deprecated.
    Returns the empty immutable multiset.
    static <E> com.google.common.collect.ImmutableMultiset<E>
    multiset(E element)
    Deprecated.
    Returns an immutable multiset containing a single element.
    static <E> com.google.common.collect.ImmutableMultiset<E>
    multiset(E e1, E e2)
    Deprecated.
    Returns an immutable multiset containing the given elements, in order.
    static <E> com.google.common.collect.ImmutableMultiset<E>
    multiset(E e1, E e2, E e3)
    Deprecated.
    Returns an immutable multiset containing the given elements, in the "grouped iteration order" described in the class documentation.
    static <E> com.google.common.collect.ImmutableMultiset<E>
    multiset(E e1, E e2, E e3, E e4)
    Deprecated.
    Returns an immutable multiset containing the given elements, in the "grouped iteration order" described in the class documentation.
    static <E> com.google.common.collect.ImmutableMultiset<E>
    multiset(E e1, E e2, E e3, E e4, E e5)
    Deprecated.
    Returns an immutable multiset containing the given elements, in the "grouped iteration order" described in the class documentation.
    static <E> com.google.common.collect.ImmutableMultiset<E>
    multiset(E e1, E e2, E e3, E e4, E e5, E e6, E... others)
    Deprecated.
    Returns an immutable multiset containing the given elements, in the "grouped iteration order" described in the class documentation.
    static <E> com.google.common.collect.ImmutableSet<E>
    set()
    Deprecated.
    Returns the empty immutable set.
    static <E> com.google.common.collect.ImmutableSet<E>
    set(E element)
    Deprecated.
    Returns an immutable set containing element.
    static <E> com.google.common.collect.ImmutableSet<E>
    set(E e1, E e2)
    Deprecated.
    Returns an immutable set containing the given elements, minus duplicates, in the order each was first specified.
    static <E> com.google.common.collect.ImmutableSet<E>
    set(E e1, E e2, E e3)
    Deprecated.
    Returns an immutable set containing the given elements, minus duplicates, in the order each was first specified.
    static <E> com.google.common.collect.ImmutableSet<E>
    set(E e1, E e2, E e3, E e4)
    Deprecated.
    Returns an immutable set containing the given elements, minus duplicates, in the order each was first specified.
    static <E> com.google.common.collect.ImmutableSet<E>
    set(E e1, E e2, E e3, E e4, E e5)
    Deprecated.
    Returns an immutable set containing the given elements, minus duplicates, in the order each was first specified.
    static <E> com.google.common.collect.ImmutableSet<E>
    set(E e1, E e2, E e3, E e4, E e5, E e6, E... others)
    Deprecated.
    Returns an immutable set containing the given elements, minus duplicates, in the order each was first specified.
    static <K, V> com.google.common.collect.ImmutableSortedMap<K,V>
    Deprecated.
    Returns the empty sorted map.
    static <K extends Comparable<? super K>, V>
    com.google.common.collect.ImmutableSortedMap<K,V>
    sortedMap(K k1, V v1)
    Deprecated.
    Returns an immutable map containing a single entry.
    static <K extends Comparable<? super K>, V>
    com.google.common.collect.ImmutableSortedMap<K,V>
    sortedMap(K k1, V v1, K k2, V v2)
    Deprecated.
    Returns an immutable sorted map containing the given entries, sorted by the natural ordering of their keys.
    static <K extends Comparable<? super K>, V>
    com.google.common.collect.ImmutableSortedMap<K,V>
    sortedMap(K k1, V v1, K k2, V v2, K k3, V v3)
    Deprecated.
    Returns an immutable sorted map containing the given entries, sorted by the natural ordering of their keys.
    static <K extends Comparable<? super K>, V>
    com.google.common.collect.ImmutableSortedMap<K,V>
    sortedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4)
    Deprecated.
    Returns an immutable sorted map containing the given entries, sorted by the natural ordering of their keys.
    static <K extends Comparable<? super K>, V>
    com.google.common.collect.ImmutableSortedMap<K,V>
    sortedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5)
    Deprecated.
    Returns an immutable sorted map containing the given entries, sorted by the natural ordering of their keys.
    static <K extends Comparable<? super K>, V>
    com.google.common.collect.ImmutableSortedMap<K,V>
    sortedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6)
    Deprecated.
    Returns an immutable sorted map containing the given entries, sorted by the natural ordering of their keys.
    static <K extends Comparable<? super K>, V>
    com.google.common.collect.ImmutableSortedMap<K,V>
    sortedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7)
    Deprecated.
    Returns an immutable sorted map containing the given entries, sorted by the natural ordering of their keys.
    static <K extends Comparable<? super K>, V>
    com.google.common.collect.ImmutableSortedMap<K,V>
    sortedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8)
    Deprecated.
    Returns an immutable sorted map containing the given entries, sorted by the natural ordering of their keys.
    static <K extends Comparable<? super K>, V>
    com.google.common.collect.ImmutableSortedMap<K,V>
    sortedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9)
    Deprecated.
    Returns an immutable sorted map containing the given entries, sorted by the natural ordering of their keys.
    static <K extends Comparable<? super K>, V>
    com.google.common.collect.ImmutableSortedMap<K,V>
    sortedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9, K k10, V v10)
    Deprecated.
    Returns an immutable sorted map containing the given entries, sorted by the natural ordering of their keys.
    static <R, C, V> com.google.common.collect.ImmutableTable<R,C,V>
    Deprecated.
    Returns an empty immutable table.
    static <R, C, V> com.google.common.collect.ImmutableTable<R,C,V>
    table(R r, C c, V v)
    Deprecated.
    Returns an immutable table containing a single cell.
    static <R, C, V> com.google.common.collect.ImmutableTable<R,C,V>
    table(R r1, C c1, V v1, R r2, C c2, V v2)
    Deprecated.
    Returns an immutable table containing two cells.

    Methods inherited from class java.lang.Object Link icon

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details Link icon

    • list Link icon

      public static <E> com.google.common.collect.ImmutableList<E> list()
      Deprecated.
      Returns the empty immutable list. This list behaves and performs comparably to Collections.emptyList(), and is preferable mainly for consistency and maintainability set your code.

      Performance note: the instance returned is a singleton.

    • list Link icon

      public static <E> com.google.common.collect.ImmutableList<E> list(E element)
      Deprecated.
      Returns an immutable list containing a single element. This list behaves and performs comparably to Collections.singletonList(T), but will not accept a null element. It is preferable mainly for consistency and maintainability list your code.
      Throws:
      NullPointerException - if element is null
    • list Link icon

      public static <E> com.google.common.collect.ImmutableList<E> list(E e1, E e2)
      Deprecated.
      Returns an immutable list containing the given elements, in order.
      Throws:
      NullPointerException - if any element is null
    • list Link icon

      public static <E> com.google.common.collect.ImmutableList<E> list(E e1, E e2, E e3)
      Deprecated.
      Returns an immutable list containing the given elements, in order.
      Throws:
      NullPointerException - if any element is null
    • list Link icon

      public static <E> com.google.common.collect.ImmutableList<E> list(E e1, E e2, E e3, E e4)
      Deprecated.
      Returns an immutable list containing the given elements, in order.
      Throws:
      NullPointerException - if any element is null
    • list Link icon

      public static <E> com.google.common.collect.ImmutableList<E> list(E e1, E e2, E e3, E e4, E e5)
      Deprecated.
      Returns an immutable list containing the given elements, in order.
      Throws:
      NullPointerException - if any element is null
    • list Link icon

      public static <E> com.google.common.collect.ImmutableList<E> list(E e1, E e2, E e3, E e4, E e5, E e6)
      Deprecated.
      Returns an immutable list containing the given elements, in order.
      Throws:
      NullPointerException - if any element is null
    • list Link icon

      public static <E> com.google.common.collect.ImmutableList<E> list(E e1, E e2, E e3, E e4, E e5, E e6, E e7)
      Deprecated.
      Returns an immutable list containing the given elements, in order.
      Throws:
      NullPointerException - if any element is null
    • list Link icon

      public static <E> com.google.common.collect.ImmutableList<E> list(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8)
      Deprecated.
      Returns an immutable list containing the given elements, in order.
      Throws:
      NullPointerException - if any element is null
    • list Link icon

      public static <E> com.google.common.collect.ImmutableList<E> list(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9)
      Deprecated.
      Returns an immutable list containing the given elements, in order.
      Throws:
      NullPointerException - if any element is null
    • list Link icon

      public static <E> com.google.common.collect.ImmutableList<E> list(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9, E e10)
      Deprecated.
      Returns an immutable list containing the given elements, in order.
      Throws:
      NullPointerException - if any element is null
    • list Link icon

      public static <E> com.google.common.collect.ImmutableList<E> list(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9, E e10, E e11)
      Deprecated.
      Returns an immutable list containing the given elements, in order.
      Throws:
      NullPointerException - if any element is null
    • list Link icon

      @SafeVarargs public static <E> com.google.common.collect.ImmutableList<E> list(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9, E e10, E e11, E e12, E... others)
      Deprecated.
      Returns an immutable list containing the given elements, in order.

      The array others must not be longer than Integer.MAX_VALUE - 12.

      Throws:
      NullPointerException - if any element is null
    • set Link icon

      public static <E> com.google.common.collect.ImmutableSet<E> set()
      Deprecated.
      Returns the empty immutable set. Preferred over Collections.emptySet() for code consistency, and because the return type conveys the immutability guarantee.

      Performance note: the instance returned is a singleton.

    • set Link icon

      public static <E> com.google.common.collect.ImmutableSet<E> set(E element)
      Deprecated.
      Returns an immutable set containing element. Preferred over Collections.singleton(T) for code consistency, null rejection, and because the return type conveys the immutability guarantee.
    • set Link icon

      public static <E> com.google.common.collect.ImmutableSet<E> set(E e1, E e2)
      Deprecated.
      Returns an immutable set containing the given elements, minus duplicates, in the order each was first specified. That is, if multiple elements are equal, all except the first are ignored.
    • set Link icon

      public static <E> com.google.common.collect.ImmutableSet<E> set(E e1, E e2, E e3)
      Deprecated.
      Returns an immutable set containing the given elements, minus duplicates, in the order each was first specified. That is, if multiple elements are equal, all except the first are ignored.
    • set Link icon

      public static <E> com.google.common.collect.ImmutableSet<E> set(E e1, E e2, E e3, E e4)
      Deprecated.
      Returns an immutable set containing the given elements, minus duplicates, in the order each was first specified. That is, if multiple elements are equal, all except the first are ignored.
    • set Link icon

      public static <E> com.google.common.collect.ImmutableSet<E> set(E e1, E e2, E e3, E e4, E e5)
      Deprecated.
      Returns an immutable set containing the given elements, minus duplicates, in the order each was first specified. That is, if multiple elements are equal, all except the first are ignored.
    • set Link icon

      @SafeVarargs public static <E> com.google.common.collect.ImmutableSet<E> set(E e1, E e2, E e3, E e4, E e5, E e6, E... others)
      Deprecated.
      Returns an immutable set containing the given elements, minus duplicates, in the order each was first specified. That is, if multiple elements are equal, all except the first are ignored.

      The array others must not be longer than Integer.MAX_VALUE - 6.

    • map Link icon

      public static <K, V> com.google.common.collect.ImmutableMap<K,V> map()
      Deprecated.
      Returns the empty map. This map behaves and performs comparably to Collections.emptyMap(), and is preferable mainly for consistency and maintainability of your code.

      Performance note: the instance returned is a singleton.

    • map Link icon

      public static <K, V> com.google.common.collect.ImmutableMap<K,V> map(K k1, V v1)
      Deprecated.
      Returns an immutable map containing a single entry. This map behaves and performs comparably to Collections.singletonMap(K, V) but will not accept a null key or value. It is preferable mainly for consistency and maintainability of your code.
    • map Link icon

      public static <K, V> com.google.common.collect.ImmutableMap<K,V> map(K k1, V v1, K k2, V v2)
      Deprecated.
      Returns an immutable map containing the given entries, in order.
      Throws:
      IllegalArgumentException - if duplicate keys are provided
    • map Link icon

      public static <K, V> com.google.common.collect.ImmutableMap<K,V> map(K k1, V v1, K k2, V v2, K k3, V v3)
      Deprecated.
      Returns an immutable map containing the given entries, in order.
      Throws:
      IllegalArgumentException - if duplicate keys are provided
    • map Link icon

      public static <K, V> com.google.common.collect.ImmutableMap<K,V> map(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4)
      Deprecated.
      Returns an immutable map containing the given entries, in order.
      Throws:
      IllegalArgumentException - if duplicate keys are provided
    • map Link icon

      public static <K, V> com.google.common.collect.ImmutableMap<K,V> map(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5)
      Deprecated.
      Returns an immutable map containing the given entries, in order.
      Throws:
      IllegalArgumentException - if duplicate keys are provided
    • map Link icon

      public static <K, V> com.google.common.collect.ImmutableMap<K,V> map(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6)
      Deprecated.
      Returns an immutable map containing the given entries, in order.
      Throws:
      IllegalArgumentException - if duplicate keys are provided
    • map Link icon

      public static <K, V> com.google.common.collect.ImmutableMap<K,V> map(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7)
      Deprecated.
      Returns an immutable map containing the given entries, in order.
      Throws:
      IllegalArgumentException - if duplicate keys are provided
    • map Link icon

      public static <K, V> com.google.common.collect.ImmutableMap<K,V> map(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8)
      Deprecated.
      Returns an immutable map containing the given entries, in order.
      Throws:
      IllegalArgumentException - if duplicate keys are provided
    • map Link icon

      public static <K, V> com.google.common.collect.ImmutableMap<K,V> map(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9)
      Deprecated.
      Returns an immutable map containing the given entries, in order.
      Throws:
      IllegalArgumentException - if duplicate keys are provided
    • map Link icon

      public static <K, V> com.google.common.collect.ImmutableMap<K,V> map(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9, K k10, V v10)
      Deprecated.
      Returns an immutable map containing the given entries, in order.
      Throws:
      IllegalArgumentException - if duplicate keys are provided
    • sortedMap Link icon

      public static <K, V> com.google.common.collect.ImmutableSortedMap<K,V> sortedMap()
      Deprecated.
      Returns the empty sorted map.

      Performance note: the instance returned is a singleton.

    • sortedMap Link icon

      public static <K extends Comparable<? super K>, V> com.google.common.collect.ImmutableSortedMap<K,V> sortedMap(K k1, V v1)
      Deprecated.
      Returns an immutable map containing a single entry.
    • sortedMap Link icon

      public static <K extends Comparable<? super K>, V> com.google.common.collect.ImmutableSortedMap<K,V> sortedMap(K k1, V v1, K k2, V v2)
      Deprecated.
      Returns an immutable sorted map containing the given entries, sorted by the natural ordering of their keys.
      Throws:
      IllegalArgumentException - if the two keys are equal according to their natural ordering
    • sortedMap Link icon

      public static <K extends Comparable<? super K>, V> com.google.common.collect.ImmutableSortedMap<K,V> sortedMap(K k1, V v1, K k2, V v2, K k3, V v3)
      Deprecated.
      Returns an immutable sorted map containing the given entries, sorted by the natural ordering of their keys.
      Throws:
      IllegalArgumentException - if any two keys are equal according to their natural ordering
    • sortedMap Link icon

      public static <K extends Comparable<? super K>, V> com.google.common.collect.ImmutableSortedMap<K,V> sortedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4)
      Deprecated.
      Returns an immutable sorted map containing the given entries, sorted by the natural ordering of their keys.
      Throws:
      IllegalArgumentException - if any two keys are equal according to their natural ordering
    • sortedMap Link icon

      public static <K extends Comparable<? super K>, V> com.google.common.collect.ImmutableSortedMap<K,V> sortedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5)
      Deprecated.
      Returns an immutable sorted map containing the given entries, sorted by the natural ordering of their keys.
      Throws:
      IllegalArgumentException - if any two keys are equal according to their natural ordering
    • sortedMap Link icon

      public static <K extends Comparable<? super K>, V> com.google.common.collect.ImmutableSortedMap<K,V> sortedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6)
      Deprecated.
      Returns an immutable sorted map containing the given entries, sorted by the natural ordering of their keys.
      Throws:
      IllegalArgumentException - if any two keys are equal according to their natural ordering
    • sortedMap Link icon

      public static <K extends Comparable<? super K>, V> com.google.common.collect.ImmutableSortedMap<K,V> sortedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7)
      Deprecated.
      Returns an immutable sorted map containing the given entries, sorted by the natural ordering of their keys.
      Throws:
      IllegalArgumentException - if any two keys are equal according to their natural ordering
    • sortedMap Link icon

      public static <K extends Comparable<? super K>, V> com.google.common.collect.ImmutableSortedMap<K,V> sortedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8)
      Deprecated.
      Returns an immutable sorted map containing the given entries, sorted by the natural ordering of their keys.
      Throws:
      IllegalArgumentException - if any two keys are equal according to their natural ordering
    • sortedMap Link icon

      public static <K extends Comparable<? super K>, V> com.google.common.collect.ImmutableSortedMap<K,V> sortedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9)
      Deprecated.
      Returns an immutable sorted map containing the given entries, sorted by the natural ordering of their keys.
      Throws:
      IllegalArgumentException - if any two keys are equal according to their natural ordering
    • sortedMap Link icon

      public static <K extends Comparable<? super K>, V> com.google.common.collect.ImmutableSortedMap<K,V> sortedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9, K k10, V v10)
      Deprecated.
      Returns an immutable sorted map containing the given entries, sorted by the natural ordering of their keys.
      Throws:
      IllegalArgumentException - if any two keys are equal according to their natural ordering
    • multimap Link icon

      public static <K, V> com.google.common.collect.ImmutableListMultimap<K,V> multimap()
      Deprecated.
      Returns the empty multimap.

      Performance note: the instance returned is a singleton.

    • multimap Link icon

      public static <K, V> com.google.common.collect.ImmutableListMultimap<K,V> multimap(K k1, V v1)
      Deprecated.
      Returns an immutable multimap containing a single entry.
    • multimap Link icon

      public static <K, V> com.google.common.collect.ImmutableListMultimap<K,V> multimap(K k1, V v1, K k2, V v2)
      Deprecated.
      Returns an immutable multimap containing the given entries, in order.
    • multimap Link icon

      public static <K, V> com.google.common.collect.ImmutableListMultimap<K,V> multimap(K k1, V v1, K k2, V v2, K k3, V v3)
      Deprecated.
      Returns an immutable multimap containing the given entries, in order.
    • multimap Link icon

      public static <K, V> com.google.common.collect.ImmutableListMultimap<K,V> multimap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4)
      Deprecated.
      Returns an immutable multimap containing the given entries, in order.
    • multimap Link icon

      public static <K, V> com.google.common.collect.ImmutableListMultimap<K,V> multimap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5)
      Deprecated.
      Returns an immutable multimap containing the given entries, in order.
    • multiset Link icon

      public static <E> com.google.common.collect.ImmutableMultiset<E> multiset()
      Deprecated.
      Returns the empty immutable multiset.

      Performance note: the instance returned is a singleton.

    • multiset Link icon

      public static <E> com.google.common.collect.ImmutableMultiset<E> multiset(E element)
      Deprecated.
      Returns an immutable multiset containing a single element.
      Throws:
      NullPointerException - if element is null
    • multiset Link icon

      public static <E> com.google.common.collect.ImmutableMultiset<E> multiset(E e1, E e2)
      Deprecated.
      Returns an immutable multiset containing the given elements, in order.
      Throws:
      NullPointerException - if any element is null
    • multiset Link icon

      public static <E> com.google.common.collect.ImmutableMultiset<E> multiset(E e1, E e2, E e3)
      Deprecated.
      Returns an immutable multiset containing the given elements, in the "grouped iteration order" described in the class documentation.
      Throws:
      NullPointerException - if any element is null
    • multiset Link icon

      public static <E> com.google.common.collect.ImmutableMultiset<E> multiset(E e1, E e2, E e3, E e4)
      Deprecated.
      Returns an immutable multiset containing the given elements, in the "grouped iteration order" described in the class documentation.
      Throws:
      NullPointerException - if any element is null
    • multiset Link icon

      public static <E> com.google.common.collect.ImmutableMultiset<E> multiset(E e1, E e2, E e3, E e4, E e5)
      Deprecated.
      Returns an immutable multiset containing the given elements, in the "grouped iteration order" described in the class documentation.
      Throws:
      NullPointerException - if any element is null
    • multiset Link icon

      @SafeVarargs public static <E> com.google.common.collect.ImmutableMultiset<E> multiset(E e1, E e2, E e3, E e4, E e5, E e6, E... others)
      Deprecated.
      Returns an immutable multiset containing the given elements, in the "grouped iteration order" described in the class documentation.
      Throws:
      NullPointerException - if any element is null
    • biMap Link icon

      public static <K, V> com.google.common.collect.ImmutableBiMap<K,V> biMap()
      Deprecated.
      Returns the empty bimap.

      Performance note: the instance returned is a singleton.

    • biMap Link icon

      public static <K, V> com.google.common.collect.ImmutableBiMap<K,V> biMap(K k1, V v1)
      Deprecated.
      Returns an immutable bimap containing a single entry.
    • biMap Link icon

      public static <K, V> com.google.common.collect.ImmutableBiMap<K,V> biMap(K k1, V v1, K k2, V v2)
      Deprecated.
      Returns an immutable map containing the given entries, in order.
      Throws:
      IllegalArgumentException - if duplicate keys or values are added
    • biMap Link icon

      public static <K, V> com.google.common.collect.ImmutableBiMap<K,V> biMap(K k1, V v1, K k2, V v2, K k3, V v3)
      Deprecated.
      Returns an immutable map containing the given entries, in order.
      Throws:
      IllegalArgumentException - if duplicate keys or values are added
    • biMap Link icon

      public static <K, V> com.google.common.collect.ImmutableBiMap<K,V> biMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4)
      Deprecated.
      Returns an immutable map containing the given entries, in order.
      Throws:
      IllegalArgumentException - if duplicate keys or values are added
    • biMap Link icon

      public static <K, V> com.google.common.collect.ImmutableBiMap<K,V> biMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5)
      Deprecated.
      Returns an immutable map containing the given entries, in order.
      Throws:
      IllegalArgumentException - if duplicate keys or values are added
    • biMap Link icon

      public static <K, V> com.google.common.collect.ImmutableBiMap<K,V> biMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6)
      Deprecated.
      Returns an immutable map containing the given entries, in order.
      Throws:
      IllegalArgumentException - if duplicate keys or values are added
    • biMap Link icon

      public static <K, V> com.google.common.collect.ImmutableBiMap<K,V> biMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7)
      Deprecated.
      Returns an immutable map containing the given entries, in order.
      Throws:
      IllegalArgumentException - if duplicate keys or values are added
    • biMap Link icon

      public static <K, V> com.google.common.collect.ImmutableBiMap<K,V> biMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8)
      Deprecated.
      Returns an immutable map containing the given entries, in order.
      Throws:
      IllegalArgumentException - if duplicate keys or values are added
    • biMap Link icon

      public static <K, V> com.google.common.collect.ImmutableBiMap<K,V> biMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9)
      Deprecated.
      Returns an immutable map containing the given entries, in order.
      Throws:
      IllegalArgumentException - if duplicate keys or values are added
    • biMap Link icon

      public static <K, V> com.google.common.collect.ImmutableBiMap<K,V> biMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9, K k10, V v10)
      Deprecated.
      Returns an immutable map containing the given entries, in order.
      Throws:
      IllegalArgumentException - if duplicate keys or values are added
    • table Link icon

      public static <R, C, V> com.google.common.collect.ImmutableTable<R,C,V> table()
      Deprecated.
      Returns an empty immutable table.

      Performance note: the instance returned is a singleton.

    • table Link icon

      public static <R, C, V> com.google.common.collect.ImmutableTable<R,C,V> table(R r, C c, V v)
      Deprecated.
      Returns an immutable table containing a single cell.
    • table Link icon

      public static <R, C, V> com.google.common.collect.ImmutableTable<R,C,V> table(R r1, C c1, V v1, R r2, C c2, V v2)
      Deprecated.
      Returns an immutable table containing two cells.