Java Map
14 functions
putmap.put(key, value)Associates the specified value with the specified key.
getmap.get(key)Returns the element at the specified index.
getOrDefaultmap.getOrDefault(key, default)Returns the value for the key, or a default if not found.
containsKeymap.containsKey(key)Returns true if the map contains the specified key.
containsValuemap.containsValue(value)Returns true if the map contains the specified value.
removemap.remove(key)Removes the element at the specified index or by value.
sizemap.size()Returns the number of elements.
isEmptymap.isEmpty()Returns true if the string length is 0.
keySetmap.keySet()Returns a Set view of the keys.
valuesmap.values()Returns a Collection view of the values.
entrySetmap.entrySet()Returns a Set view of the key-value mappings.
putIfAbsentmap.putIfAbsent(key, value)Inserts the value only if the key is not already present.
mergemap.merge(key, value, remappingFn)Merges the value with remapping function if key exists, otherwise inserts.
forEachmap.forEach((k, v) -> { ... })Performs the given action for each entry.
