public class BLCMapUtils extends Object
Constructor and Description |
---|
BLCMapUtils() |
Modifier and Type | Method and Description |
---|---|
static <K,CV extends Iterable<V>,V> |
keyedListMap(CV values,
TypedClosure<K,V> closure)
Given a collection of values and a TypedClosure that maps an appropriate key for a given value,
returns a HashMap of the key to a list of values that map to that key.
|
static <K,CV extends Iterable<V>,V> |
keyedMap(CV values,
TypedClosure<K,V> closure)
Given a collection of values and a TypedClosure that maps an appropriate key for a given value,
returns a HashMap of the key to the value.
|
static <K,V> Map<K,V> |
keyedMap(V[] values,
TypedClosure<K,V> closure)
Given an array of values and a TypedClosure that maps an appropriate key for a given value,
returns a HashMap of the key to the value.
|
static <K,V> Map<K,V> |
valueSortedMap(Map<K,V> map,
Comparator<Map.Entry<K,V>> comparator) |
public static <K,CV extends Iterable<V>,V> Map<K,V> keyedMap(CV values, TypedClosure<K,V> closure)
values
- closure
- List --> Map
public static <K,V> Map<K,V> keyedMap(V[] values, TypedClosure<K,V> closure)
values
- closure
- V[] --> Map
public static <K,CV extends Iterable<V>,V> Map<K,List<V>> keyedListMap(CV values, TypedClosure<K,V> closure)
values
- closure
- List --> Map>
public static <K,V> Map<K,V> valueSortedMap(Map<K,V> map, Comparator<Map.Entry<K,V>> comparator)
Copyright © 2022. All rights reserved.