com.hazelcast.util

## Class MapUtil

- java.lang.Object
- - com.hazelcast.util.MapUtil

-     public final class MapUtil
      extends Object

  Utility class for Maps

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <K,V> ConcurrentMap<K,V>` | `createConcurrentHashMap(int expectedMapSize)` Utility method that creates an `LinkedHashMap` with its initialCapacity calculated to minimize rehash operations
    `static <K,V> Map<K,V>` | `createHashMap(int expectedMapSize)` Utility method that creates an `HashMap` with its initialCapacity calculated to minimize rehash operations
    `static <K,V> Map<K,V>` | `createHashMapAdapter(int expectedMapSize)` Utility method that creates an `HashMapAdapter` with its initialCapacity calculated to minimize rehash operations
    `static <V> Int2ObjectHashMap<V>` | `createInt2ObjectHashMap(int expectedMapSize)` Utility method that creates an `Int2ObjectHashMap` with its initialCapacity calculated to minimize rehash operations
    `static <K,V> Map<K,V>` | `createLinkedHashMap(int expectedMapSize)` Utility method that creates an `LinkedHashMap` with its initialCapacity calculated to minimize rehash operations
    `static boolean` | `isNullOrEmpty(Map map)` Test the given map and return `true` if the map is null or empty.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### createHashMap

          public static <K,V> Map<K,V> createHashMap(int expectedMapSize)

      Utility method that creates an `HashMap` with its initialCapacity calculated to minimize rehash operations

    - #### createHashMapAdapter

          public static <K,V> Map<K,V> createHashMapAdapter(int expectedMapSize)

      Utility method that creates an `HashMapAdapter` with its initialCapacity calculated to minimize rehash operations

    - #### createLinkedHashMap

          public static <K,V> Map<K,V> createLinkedHashMap(int expectedMapSize)

      Utility method that creates an `LinkedHashMap` with its initialCapacity calculated to minimize rehash operations

    - #### createConcurrentHashMap

          public static <K,V> ConcurrentMap<K,V> createConcurrentHashMap(int expectedMapSize)

      Utility method that creates an `LinkedHashMap` with its initialCapacity calculated to minimize rehash operations

    - #### createInt2ObjectHashMap

          public static <V> Int2ObjectHashMap<V> createInt2ObjectHashMap(int expectedMapSize)

      Utility method that creates an `Int2ObjectHashMap` with its initialCapacity calculated to minimize rehash operations

    - #### isNullOrEmpty

          public static boolean isNullOrEmpty(Map map)

      Test the given map and return `true` if the map is null or empty.
      Parameters:
        `map` - the map to test
      Returns:
        `true` if `map` is null or empty, otherwise `false`.

Copyright © 2018. All rights reserved.