Package science.aist.jack.stream
Class MapUtils
- java.lang.Object
-
- science.aist.jack.stream.MapUtils
-
public final class MapUtils extends Object
- Since:
- 2.0
- Author:
- Andreas Pointner
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <K,V>
Map<K,V>mapOfValues(Pair<K,V>... pairs)
Creates a Map out of pairsstatic <V> Map<String,V>
prefixMapKey(Map<String,V> input, String prefix)
This function clones the map and add a prefix to all keys from the new map.
-
-
-
Method Detail
-
prefixMapKey
public static <V> Map<String,V> prefixMapKey(Map<String,V> input, String prefix)
This function clones the map and add a prefix to all keys from the new map. so if input is a map with one element e.g. test -> myObj and prefix is aist_ the result would be a map with one element with aist_test -> myObj- Type Parameters:
V
- type of the value of the map- Parameters:
input
- the mapprefix
- the prefix to be added- Returns:
- the new map
-
mapOfValues
@SafeVarargs public static <K,V> Map<K,V> mapOfValues(Pair<K,V>... pairs)
Creates a Map out of pairs- Type Parameters:
K
- the type of the keyV
- the type of the value- Parameters:
pairs
- the key value pairs- Returns:
- the resulting map
-
-