|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.omnaest.utils.structure.map.MapUtils
public class MapUtils
Helper class for Map operations.
| Nested Class Summary | |
|---|---|
static interface |
MapUtils.MapElementMergeOperation<K,V>
A MapUtils.MapElementMergeOperation defines a MapUtils.MapElementMergeOperation.merge(Object, Object, Map) operation to merge Map elements into
a merged Map instance. |
| Constructor Summary | |
|---|---|
MapUtils()
|
|
| Method Summary | ||
|---|---|---|
static
|
convertMap(Map<KeyFrom,ValueFrom> map,
CollectionUtils.ElementConverter<KeyFrom,KeyTo> keyElementConverter,
CollectionUtils.ElementConverter<ValueFrom,ValueTo> valueElementConverter)
Converts a given map into a new map with new types. |
|
static
|
convertMapKey(Map<KeyFrom,Value> map,
CollectionUtils.ElementConverter<KeyFrom,KeyTo> keyElementConverter)
Converts the key of a map into another key. |
|
static
|
innerJoinMapByKey(Map<K,VA> mapA,
Map<K,VB> mapB)
Returns a list of TupleDuad instances which have always the value of the first map and the value of the second map
which share the same key over both maps. |
|
static
|
mergeAll(Collection<Map<K,V>> mapCollection)
Merges all given Map instances into a single LinkedHashMap. |
|
static
|
mergeAll(Collection<Map<K,V>> mapCollection,
MapUtils.MapElementMergeOperation<K,V> mapElementMergeOperation)
Merges all given Map instances into a single LinkedHashMap using the given MapUtils.MapElementMergeOperation. |
|
static
|
mergeAll(Map<K,V>... maps)
Merges all given Map instances into a single LinkedHashMap. |
|
static
|
mergeAll(MapUtils.MapElementMergeOperation<K,V> mapElementMergeOperation,
Map<K,V>... maps)
Merges all given Map instances into a single LinkedHashMap using the given MapUtils.MapElementMergeOperation. |
|
static
|
toString(Map<K,V> map)
Returns a String representation for a Map |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MapUtils()
| Method Detail |
|---|
public static <K,V> Map<K,V> mergeAll(MapUtils.MapElementMergeOperation<K,V> mapElementMergeOperation,
Map<K,V>... maps)
Map instances into a single LinkedHashMap using the given MapUtils.MapElementMergeOperation.
K - V - mapElementMergeOperation - maps -
mergeAll(Map...),
mergeAll(Collection, MapElementMergeOperation)
public static <K,V> Map<K,V> mergeAll(Collection<Map<K,V>> mapCollection,
MapUtils.MapElementMergeOperation<K,V> mapElementMergeOperation)
Map instances into a single LinkedHashMap using the given MapUtils.MapElementMergeOperation.
K - V - mapCollection - mapElementMergeOperation -
mergeAll(Map...)public static <K,V> Map<K,V> mergeAll(Collection<Map<K,V>> mapCollection)
Map instances into a single LinkedHashMap.
K - V - mapCollection -
mergeAll(Map...)public static <K,V> Map<K,V> mergeAll(Map<K,V>... maps)
Map instances into a single LinkedHashMap.
K - V - maps -
mergeAll(Collection),
mergeAll(Collection, MapElementMergeOperation)
public static <K,VA,VB> List<TupleDuad<VA,VB>> innerJoinMapByKey(Map<K,VA> mapA,
Map<K,VB> mapB)
TupleDuad instances which have always the value of the first map and the value of the second map
which share the same key over both maps.
K - VA - VB - mapA - mapB -
public static <KeyFrom,KeyTo,Value> Map<KeyTo,Value> convertMapKey(Map<KeyFrom,Value> map,
CollectionUtils.ElementConverter<KeyFrom,KeyTo> keyElementConverter)
KeyFrom - KeyTo - Value - map - keyElementConverter -
public static <KeyFrom,KeyTo,ValueFrom,ValueTo> Map<KeyTo,ValueTo> convertMap(Map<KeyFrom,ValueFrom> map,
CollectionUtils.ElementConverter<KeyFrom,KeyTo> keyElementConverter,
CollectionUtils.ElementConverter<ValueFrom,ValueTo> valueElementConverter)
map - keyElementConverter - valueElementConverter -
CollectionUtils.ElementConverterpublic static <K,V> String toString(Map<K,V> map)
String representation for a Map
map -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||