java.lang.Object |
↳ |
java.util.AbstractMap<K, V> |
|
↳ |
java.util.HashMap<K, V> |
|
|
↳ |
com.facebook.common.internal.ImmutableMap<K, V> |
Class Overview
Utility class to create immutable maps.
We do not replicate Guava's ImmutableMap class here. This class merely returns standard HashMaps wrapped so that they throw UnsupportedOperationExceptions on any write method.
Summary
Public Methods |
static
<K, V>
ImmutableMap<K, V>
|
copyOf(Map<? extends K, ? extends V> map)
|
static
<K, V>
Map<K, V>
|
of(K k1, V v1, K k2, V v2)
|
static
<K, V>
Map<K, V>
|
of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4)
|
static
<K, V>
Map<K, V>
|
of(K k1, V v1)
|
static
<K, V>
Map<K, V>
|
of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6)
|
static
<K, V>
Map<K, V>
|
of(K k1, V v1, K k2, V v2, K k3, V v3)
|
static
<K, V>
Map<K, V>
|
of()
|
static
<K, V>
Map<K, V>
|
of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5)
|
[Expand]
Inherited Methods |
From class
java.util.HashMap
void
|
clear()
|
Object
|
clone()
|
boolean
|
containsKey(Object arg0)
|
boolean
|
containsValue(Object arg0)
|
Set<Entry<K, V>>
|
entrySet()
|
void
|
forEach(BiConsumer<? super K, ? super V> arg0)
|
V
|
get(Object arg0)
|
boolean
|
isEmpty()
|
Set<K>
|
keySet()
|
V
|
put(K arg0, V arg1)
|
void
|
putAll(Map<? extends K, ? extends V> arg0)
|
V
|
remove(Object arg0)
|
boolean
|
replace(K arg0, V arg1, V arg2)
|
void
|
replaceAll(BiFunction<? super K, ? super V, ? extends V> arg0)
|
int
|
size()
|
Collection<V>
|
values()
|
|
From class
java.util.AbstractMap
void
|
clear()
|
Object
|
clone()
|
boolean
|
containsKey(Object arg0)
|
boolean
|
containsValue(Object arg0)
|
abstract
Set<Entry<K, V>>
|
entrySet()
|
boolean
|
equals(Object arg0)
|
V
|
get(Object arg0)
|
int
|
hashCode()
|
boolean
|
isEmpty()
|
Set<K>
|
keySet()
|
V
|
put(K arg0, V arg1)
|
void
|
putAll(Map<? extends K, ? extends V> arg0)
|
V
|
remove(Object arg0)
|
int
|
size()
|
String
|
toString()
|
Collection<V>
|
values()
|
|
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
From interface
java.util.Map
abstract
void
|
clear()
|
abstract
V
|
compute(K arg0, BiFunction<? super K, ? super V, ? extends V> arg1)
|
abstract
V
|
computeIfAbsent(K arg0, Function<? super K, ? extends V> arg1)
|
abstract
V
|
computeIfPresent(K arg0, BiFunction<? super K, ? super V, ? extends V> arg1)
|
abstract
boolean
|
containsKey(Object arg0)
|
abstract
boolean
|
containsValue(Object arg0)
|
abstract
Set<Entry<K, V>>
|
entrySet()
|
abstract
boolean
|
equals(Object arg0)
|
abstract
void
|
forEach(BiConsumer<? super K, ? super V> arg0)
|
abstract
V
|
get(Object arg0)
|
abstract
V
|
getOrDefault(Object arg0, V arg1)
|
abstract
int
|
hashCode()
|
abstract
boolean
|
isEmpty()
|
abstract
Set<K>
|
keySet()
|
abstract
V
|
merge(K arg0, V arg1, BiFunction<? super V, ? super V, ? extends V> arg2)
|
abstract
V
|
put(K arg0, V arg1)
|
abstract
void
|
putAll(Map<? extends K, ? extends V> arg0)
|
abstract
V
|
putIfAbsent(K arg0, V arg1)
|
abstract
boolean
|
remove(Object arg0, Object arg1)
|
abstract
V
|
remove(Object arg0)
|
abstract
boolean
|
replace(K arg0, V arg1, V arg2)
|
abstract
V
|
replace(K arg0, V arg1)
|
abstract
void
|
replaceAll(BiFunction<? super K, ? super V, ? extends V> arg0)
|
abstract
int
|
size()
|
abstract
Collection<V>
|
values()
|
|
Public Methods
public
static
ImmutableMap<K, V>
copyOf
(Map<? extends K, ? extends V> map)
public
static
Map<K, V>
of
(K k1, V v1, K k2, V v2)
public
static
Map<K, V>
of
(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4)
public
static
Map<K, V>
of
(K k1, V v1)
public
static
Map<K, V>
of
(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6)
public
static
Map<K, V>
of
(K k1, V v1, K k2, V v2, K k3, V v3)
public
static
Map<K, V>
of
()
public
static
Map<K, V>
of
(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5)