Kotlin Map
15 functions
mapOfmapOf(vararg pairs)Returns a new read-only map with the specified contents.
mutableMapOfmutableMapOf(vararg pairs)Returns a new MutableMap with the specified contents.
putmap.put(key, value) / map[key] = valueAssociates the specified value with the specified key in the map.
getmap.get(key) / map[key]Returns the element at the specified index.
getOrDefaultmap.getOrDefault(key, default)Returns the value for the specified key, or the default value if the key is not found.
getOrElsemap.getOrElse(key) { default }Returns the value for the given key, or the result of the defaultValue function.
containsKeymap.containsKey(key)Returns true if the map contains the specified key.
containsValuemap.containsValue(value)Returns true if the map maps one or more keys to the specified value.
removemap.remove(key)Removes an element or removes the element at a specified index.
keysmap.keysReturns a read-only Set of all keys in this map.
valuesmap.valuesReturns a read-only Collection of all values in this map.
entriesmap.entriesReturns a read-only Set of all key/value pairs in this map.
forEachmap.forEach { k, v -> }모든 항목에 대해 동작을 수행합니다.
filterKeysmap.filterKeys { predicate }Returns a map containing all key-value pairs with keys matching the given predicate.
mapValuesmap.mapValues { entry -> }Returns a new map with entries having the keys of this map and the values obtained by applying the transform function.
