List of utility methods to do Map Add
void | addToMap(String aDimensionCriteria, Map add To Map int p = aDimensionCriteria.indexOf("="); aDrilldownDimensions.put(aDimensionCriteria.substring(0, p), aDimensionCriteria.substring(p + 1)); |
void | addToMap(String key, Map add To Map map.put(key, value); |
void | addToMapIfNotNull(Map Adds a value V into a map under key K only if the value is not null. if (value == null) { return; map.put(key, value); |
void | addToMapIfNotNull(Map add To Map If Not Null addToMapIfNotNull(map, key, value, "");
|
void | addToMapListUnique(Map add To Map List Unique List<U> list = mapList.get(key); if (list == null) { list = new ArrayList<U>(values.size()); mapList.put(key, list); for (U value : values) { if (!list.contains(value)) { list.add(value); ... |
void | addToMapMap(Map Adds the given key-value mapping to the given map. Map<K2, V> innerMap = map.get(key1); if (innerMap == null) { innerMap = new HashMap<K2, V>(); map.put(key1, innerMap); innerMap.put(key2, value); |
void | addToMapMap(Map add To Map Map if (!map.containsKey(key)) { Map<V, Integer> newMap = new HashMap<V, Integer>(); addToMap(newMap, val); map.put(key, newMap); } else { addToMap(map.get(key), val); |
void | addToMapOfLists(Map add To Map Of Lists List<T> list = map.get(key); if (list == null) { list = new ArrayList<T>(); map.put(key, list); list.add(value); |
Map | arrayAsMap(Object... t) array As Map if (t == null || t.length <= 0) { return null; if (t.length % 2 != 0) { throw new RuntimeException("illegal args count"); Map<String, Object> params = new HashMap<String, Object>(t.length); for (int i = 0; i < t.length; i += 2) { ... |
Map | arrayToMap(int[] array) array To Map Map<Integer, Integer> ret = new HashMap<Integer, Integer>(); for (int i = 0; i < array.length; i++) ret.put(i + 1, array[i]); return ret; |