Package com.norconex.commons.lang.map

# Class MapUtil

java.lang.Object
com.norconex.commons.lang.map.MapUtil

public final class MapUtil extends Object
Map-related utility methods.

Since:
  2.0.0

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static <K, V> Map<K,V>`
  `toMap(Object... values)`
  Converts a array of values to a map, alternating between key and values.
  `static <K, V> void`
  `toMap(Map<K,V> map, Object... values)`
  Populates an existing map with the array of values, alternating between key and values.

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

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

- ## Method Details

  - ### toMap

    public static <K, V> Map<K,V> toMap(Object... values)
    Converts a array of values to a map, alternating between key and values.
    Type Parameters:
      `K` - map key type
      `V` - map value type
    Parameters:
      `values` - to convert
    Returns:
      the new map

  - ### toMap

    public static <K, V> void toMap(Map<K,V> map, Object... values)
    Populates an existing map with the array of values, alternating between key and values.
    Type Parameters:
      `K` - map key type
      `V` - map value type
    Parameters:
      `map` - the map to fill with values
      `values` - to convert