List of utility methods to do Map Create
Map | map(Map Adds a entry to a map namely (key,value). accumulator.put(key, value);
return accumulator;
|
String | map(Map map String s = line.substring(0, firstTabIdx); Integer integer = outcomeMapping.get(s); if (integer == null) { return s; return integer.toString(); |
Map | map(Object key, Object value) map Map map = new HashMap(); map.put(key, value); return map; |
Map | map(Object obj) Readability method for casting. return (Map<String, Object>) obj;
|
Map | map(Object... args) map if (args.length % 2 != 0) throw new IllegalArgumentException("Length of arguments must be a multiple of 2"); else if (args.length == 0) return Collections.emptyMap(); Map<K, V> ret = new HashMap<>(args.length / 2); for (int idx = 0; idx < args.length; idx += 2) { ret.put((K) args[idx], (V) args[idx + 1]); return ret; |
Map | map(Object... data) map Map<K, V> map = new HashMap<K, V>(data.length + 2); for (int i = 1; i < data.length; i += 2) { map.put((K) data[i - 1], (V) data[i]); return map; |
Map | map(Object... data) This is useful to create a map of object in declarative way. Map<K, V> map = new HashMap<K, V>(data.length + 2); for (int i = 1; i < data.length; i += 2) { map.put((K) data[i - 1], (V) data[i]); return map; |