List of utility methods to do Map Create
Map | buildMap(K key, V value) build Map Map<K, V> map = new HashMap<K, V>(); map.put(key, value); return map; |
Map | buildMap(K key1, V value1) Build Map with 1 pair. Map<K, V> map = new HashMap<K, V>(1); map.put(key1, value1); return map; |
void | buildMap(List extends T> a, Map build Map for (T t : a) { Integer coeff = coeffs.get(t); if (coeff == null) { coeffs.put(t, 1); } else { coeffs.put(t, coeff + 1); |
Map | buildMap(Object key, Object value) build Map return buildMap(key, value, null, null, null, null, null, null, null, null, null, null);
|
Map | buildMap(Object... data) Builds a map out of parameters HashMap<String, Object> result = new HashMap<String, Object>(); if (data.length % 2 != 0) throw new IllegalArgumentException("Odd number of arguments"); String key = null; Integer step = -1; for (Object value : data) { step++; switch (step % 2) { ... |
Map | buildMap(String... keysAndValues) build Map Map<String, String> map = new HashMap<String, String>(); for (int i = 0; i < keysAndValues.length;) { map.put(keysAndValues[i], keysAndValues[i + 1]); i += 2; return map; |
Map | buildMap(String... keyValuePairs) Builds a map of key/value pairs. if (keyValuePairs.length % 2 != 0) throw new IllegalArgumentException("keyValuePairs array not dividable by 2 (key + value)"); Map<String, String> map = new HashMap<String, String>(); for (int i = 0; i < keyValuePairs.length; i += 2) { map.put(keyValuePairs[i], keyValuePairs[i + 1]); return map; |
Map | createMap() create Map return createMap(Collections.EMPTY_MAP);
|
Map | createMap() create Map Map<String, String[]> result = new HashMap<String, String[]>(); result.put("echoResponse", new String[] {}); return Collections.unmodifiableMap(result); |
Map | createMap() create Map return createMap(INITIAL_CAPACITY);
|