public class

ImmutableMap

extends HashMap<K, V>
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
From class java.util.AbstractMap
From class java.lang.Object
From interface java.util.Map

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)