Package com.netflix.discovery.util
Class MapUtil
- java.lang.Object
-
- com.netflix.discovery.util.MapUtil
-
public final class MapUtil extends java.lang.ObjectUtility methods for working with Maps.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <K,V>
java.util.HashMap<K,V>newHashMapWithExpectedSize(int expectedSize)Creates a HashMap with enough capacity to hold the expected number of entries without resizing.
-
-
-
Method Detail
-
newHashMapWithExpectedSize
public static <K,V> java.util.HashMap<K,V> newHashMapWithExpectedSize(int expectedSize)
Creates a HashMap with enough capacity to hold the expected number of entries without resizing. This is equivalent to Guava's Maps.newHashMapWithExpectedSize().- Type Parameters:
K- the key typeV- the value type- Parameters:
expectedSize- the expected number of entries- Returns:
- a new HashMap with appropriate initial capacity
-
-