The list of methods to do Map Create are organized into topic(s).
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);