public final class MultivaluedMapUtils extends Object
Modifier and Type | Method | Description |
---|---|---|
static <K,V> V |
getFirstValue(Map<K,List<V>> map,
K key) |
Gets the first value for the specified key.
|
static <K,V> V |
removeAndReturnFirstValue(Map<K,List<V>> map,
String key) |
Removes the entry for the specified key and returns its first value.
|
static <K,V> Map<K,V> |
toSingleValuedMap(Map<K,List<V>> map) |
Converts the specified multi-valued map to a single-valued map by
taking the first value in the list.
|
public static <K,V> Map<K,V> toSingleValuedMap(Map<K,List<V>> map)
map
- The multi-valued map, null
if not specified.null
if no map was specified.public static <K,V> V getFirstValue(Map<K,List<V>> map, K key)
map
- The multi-valued map. Must not be null
.key
- The key. Must not be null
.null
if not set.public static <K,V> V removeAndReturnFirstValue(Map<K,List<V>> map, String key)
map
- The multi-valued map. Must not be null
.key
- The key. Must not be null
.null
if not set.Copyright © 2019 Connect2id Ltd.. All rights reserved.