Class MapBuilder<K,​V>


public class MapBuilder<K,​V> extends Object
  • Constructor Details

    • MapBuilder

      public MapBuilder()
    • MapBuilder

      public MapBuilder(Map<K,​V> map)
  • Method Details

    • newMapBuilder

      public static <K,​ V> MapBuilder<K,​V> newMapBuilder()
    • newMapBuilder

      public static <K,​ V> MapBuilder<K,​V> newMapBuilder(Map<K,​V> map)
    • putAll

      public MapBuilder<K,​V> putAll(Map<K,​V> map)
    • put

      public MapBuilder<K,​V> put(K key, V value)
    • remove

      public MapBuilder<K,​V> remove(K key)
    • clear

      public MapBuilder<K,​V> clear()
    • get

      public V get(K key)
    • containsKey

      public boolean containsKey(K key)
    • isEmpty

      public boolean isEmpty()
    • map

      public Map<K,​V> map()
    • immutableMap

      public Map<K,​V> immutableMap()
      Build an immutable copy of the map under construction. Always copies the map under construction. Prefer building a HashMap by hand and wrapping it in an unmodifiableMap