Top Description Inners Constructors Methods
com.google.common.collect

public abstract Class ImmutableBiMap<K, V>

extends ImmutableBiMapFauxverideShim<K, V>
implements BiMap<K, V>
Class Inheritance
All Implemented Interfaces
com.google.common.collect.BiMap, java.util.Map
Known Direct Subclasses
com.google.common.collect.JdkBackedImmutableBiMap, com.google.common.collect.RegularImmutableBiMap, com.google.common.collect.RegularImmutableBiMap.Inverse, com.google.common.collect.SingletonImmutableBiMap
Annotations
@GwtCompatible
serializable:true
emulated:true
@ElementTypesAreNonnullByDefault
Static Imports
com.google.common.base.Preconditions.checkState, com.google.common.collect.CollectPreconditions.checkNonnegative, java.util.Objects.requireNonNull

A BiMap whose contents will never change, with many other important properties detailed at ImmutableCollection.
Author
Jared Levy
Since
2.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
ImmutableBiMap.Builder<K, V>

A builder for creating immutable bimap instances, especially public static final bimaps ("constant bimaps").

private static class
ImmutableBiMap.SerializedForm<K, V>

Serialized type for all ImmutableBiMap instances.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public static <K, V> ImmutableBiMap.Builder<K, V>
public static <K, V> ImmutableBiMap.Builder<K, V>
builderWithExpectedSize(int expectedSize)

Hides com.google.common.collect.ImmutableMap.builderWithExpectedSize.

Returns a new builder, expecting the specified number of entries to be added.
public static <K, V> ImmutableBiMap<K, V>
copyOf(Map<? extends K, ? extends V>
a Map from which entries are drawn, must be non-null
map
)

Hides com.google.common.collect.ImmutableMap.copyOf, java.util.Map.copyOf.

Returns an immutable bimap containing the same entries as map.
public static <K, V> ImmutableBiMap<K, V>
copyOf(Iterable<? extends Map.Entry<? extends K, ? extends V>> entries)

Hides com.google.common.collect.ImmutableMap.copyOf.

Returns an immutable bimap containing the given entries.
pack-priv final ImmutableSet<V>
public final V
forcePut(K
the key with which the specified value is to be associated
key
,
V
the value to be associated with the specified key
value
)

Implements com.google.common.collect.BiMap.forcePut.

Deprecated Unsupported operation.
Guaranteed to throw an exception and leave the bimap unmodified.
public abstract ImmutableBiMap<V, K>
inverse()

Redeclares com.google.common.collect.BiMap.inverse.

Returns the inverse view of this bimap, which maps each of this bimap's values to its associated key.
public static <K, V> ImmutableBiMap<K, V>
public static <K, V> ImmutableBiMap<K, V>
of(K
the mapping's key
k1
,
V
the mapping's value
v1
)

Hides com.google.common.collect.ImmutableMap.of, java.util.Map.of.

Returns an immutable bimap containing a single entry.
public static <K, V> ImmutableBiMap<K, V>
of(K
the first mapping's key
k1
,
V
the first mapping's value
v1
,
K
the second mapping's key
k2
,
V
the second mapping's value
v2
)

Hides com.google.common.collect.ImmutableMap.of, java.util.Map.of.

Returns an immutable map containing the given entries, in order.
public static <K, V> ImmutableBiMap<K, V>
of(K
the first mapping's key
k1
,
V
the first mapping's value
v1
,
K
the second mapping's key
k2
,
V
the second mapping's value
v2
,
K
the third mapping's key
k3
,
V
the third mapping's value
v3
)

Hides com.google.common.collect.ImmutableMap.of, java.util.Map.of.

Returns an immutable map containing the given entries, in order.
public static <K, V> ImmutableBiMap<K, V>
of(K
the first mapping's key
k1
,
V
the first mapping's value
v1
,
K
the second mapping's key
k2
,
V
the second mapping's value
v2
,
K
the third mapping's key
k3
,
V
the third mapping's value
v3
,
K
the fourth mapping's key
k4
,
V
the fourth mapping's value
v4
)

Hides com.google.common.collect.ImmutableMap.of, java.util.Map.of.

Returns an immutable map containing the given entries, in order.
public static <K, V> ImmutableBiMap<K, V>
of(K
the first mapping's key
k1
,
V
the first mapping's value
v1
,
K
the second mapping's key
k2
,
V
the second mapping's value
v2
,
K
the third mapping's key
k3
,
V
the third mapping's value
v3
,
K
the fourth mapping's key
k4
,
V
the fourth mapping's value
v4
,
K
the fifth mapping's key
k5
,
V
the fifth mapping's value
v5
)

Hides com.google.common.collect.ImmutableMap.of, java.util.Map.of.

Returns an immutable map containing the given entries, in order.
public static <K, V> ImmutableBiMap<K, V>
of(K
the first mapping's key
k1
,
V
the first mapping's value
v1
,
K
the second mapping's key
k2
,
V
the second mapping's value
v2
,
K
the third mapping's key
k3
,
V
the third mapping's value
v3
,
K
the fourth mapping's key
k4
,
V
the fourth mapping's value
v4
,
K
the fifth mapping's key
k5
,
V
the fifth mapping's value
v5
,
K
the sixth mapping's key
k6
,
V
the sixth mapping's value
v6
)

Hides com.google.common.collect.ImmutableMap.of, java.util.Map.of.

Returns an immutable map containing the given entries, in order.
public static <K, V> ImmutableBiMap<K, V>
of(K
the first mapping's key
k1
,
V
the first mapping's value
v1
,
K
the second mapping's key
k2
,
V
the second mapping's value
v2
,
K
the third mapping's key
k3
,
V
the third mapping's value
v3
,
K
the fourth mapping's key
k4
,
V
the fourth mapping's value
v4
,
K
the fifth mapping's key
k5
,
V
the fifth mapping's value
v5
,
K
the sixth mapping's key
k6
,
V
the sixth mapping's value
v6
,
K
the seventh mapping's key
k7
,
V
the seventh mapping's value
v7
)

Hides com.google.common.collect.ImmutableMap.of, java.util.Map.of.

Returns an immutable map containing the given entries, in order.
public static <K, V> ImmutableBiMap<K, V>
of(K
the first mapping's key
k1
,
V
the first mapping's value
v1
,
K
the second mapping's key
k2
,
V
the second mapping's value
v2
,
K
the third mapping's key
k3
,
V
the third mapping's value
v3
,
K
the fourth mapping's key
k4
,
V
the fourth mapping's value
v4
,
K
the fifth mapping's key
k5
,
V
the fifth mapping's value
v5
,
K
the sixth mapping's key
k6
,
V
the sixth mapping's value
v6
,
K
the seventh mapping's key
k7
,
V
the seventh mapping's value
v7
,
K
the eighth mapping's key
k8
,
V
the eighth mapping's value
v8
)

Hides com.google.common.collect.ImmutableMap.of, java.util.Map.of.

Returns an immutable map containing the given entries, in order.
public static <K, V> ImmutableBiMap<K, V>
of(K
the first mapping's key
k1
,
V
the first mapping's value
v1
,
K
the second mapping's key
k2
,
V
the second mapping's value
v2
,
K
the third mapping's key
k3
,
V
the third mapping's value
v3
,
K
the fourth mapping's key
k4
,
V
the fourth mapping's value
v4
,
K
the fifth mapping's key
k5
,
V
the fifth mapping's value
v5
,
K
the sixth mapping's key
k6
,
V
the sixth mapping's value
v6
,
K
the seventh mapping's key
k7
,
V
the seventh mapping's value
v7
,
K
the eighth mapping's key
k8
,
V
the eighth mapping's value
v8
,
K
the ninth mapping's key
k9
,
V
the ninth mapping's value
v9
)

Hides com.google.common.collect.ImmutableMap.of, java.util.Map.of.

Returns an immutable map containing the given entries, in order.
public static <K, V> ImmutableBiMap<K, V>
of(K
the first mapping's key
k1
,
V
the first mapping's value
v1
,
K
the second mapping's key
k2
,
V
the second mapping's value
v2
,
K
the third mapping's key
k3
,
V
the third mapping's value
v3
,
K
the fourth mapping's key
k4
,
V
the fourth mapping's value
v4
,
K
the fifth mapping's key
k5
,
V
the fifth mapping's value
v5
,
K
the sixth mapping's key
k6
,
V
the sixth mapping's value
v6
,
K
the seventh mapping's key
k7
,
V
the seventh mapping's value
v7
,
K
the eighth mapping's key
k8
,
V
the eighth mapping's value
v8
,
K
the ninth mapping's key
k9
,
V
the ninth mapping's value
v9
,
K
the tenth mapping's key
k10
,
V
the tenth mapping's value
v10
)

Hides com.google.common.collect.ImmutableMap.of, java.util.Map.of.

Returns an immutable map containing the given entries, in order.
public static <K, V> ImmutableBiMap<K, V>
ofEntries(Map.Entry<? extends K, ? extends V>...
Map.Entrys containing the keys and values from which the map is populated
entries
)

Hides com.google.common.collect.ImmutableMap.ofEntries, java.util.Map.ofEntries.

Returns an immutable map containing the given entries, in order.
private void
public static <T extends @Nullable Object, K, V> Collector<T, ?, ImmutableBiMap<K, V>>
toImmutableBiMap(Function<? super T, ? extends K> keyFunction, Function<? super T, ? extends V> valueFunction)

Returns a Collector that accumulates elements into an ImmutableBiMap whose keys and values are the result of applying the provided mapping functions to the input elements.

public ImmutableSet<V>
values()

Overrides com.google.common.collect.ImmutableMap.values.

Implements com.google.common.collect.BiMap.values, java.util.Map.values.

Returns an immutable set of the values in this map, in the same order they appear in entrySet.
pack-priv Object
writeReplace()

Overrides com.google.common.collect.ImmutableMap.writeReplace.

Returns a serializable form of this object.
Inherited from com.google.common.collect.ImmutableBiMapFauxverideShim:
toImmutableMaptoImmutableMap