getValue

inline operator fun <V, V1 : V> Map<in String, V>.getValue(thisRef: Any?, property: KProperty<*>): V1(source)

Returns the value of the property for the given object from this read-only map.

Since Kotlin

1.1

Return

the property value.

Parameters

thisRef

the object for which the value is requested (not used).

property

the metadata for the property, used to get the name of property and lookup the value corresponding to this name in the map.

Throws

when the map doesn't contain value for the property name and doesn't provide an implicit default (see withDefault).


inline operator fun <V, V1 : V> MutableMap<in String, out V>.getValue(thisRef: Any?, property: KProperty<*>): V1(source)

Returns the value of the property for the given object from this mutable map.

Since Kotlin

1.1

Return

the property value.

Parameters

thisRef

the object for which the value is requested (not used).

property

the metadata for the property, used to get the name of property and lookup the value corresponding to this name in the map.

Throws

when the map doesn't contain value for the property name and doesn't provide an implicit default (see withDefault).


fun <K, V> Map<K, V>.getValue(key: K): V(source)

Returns the value for the given key or throws an exception if there is no such key in the map.

If the map was created by withDefault, resorts to its defaultValue provider function instead of throwing an exception.

Since Kotlin

1.1

Throws

when the map doesn't contain a value for the specified key and no implicit default value was provided for that map.

inline operator fun <V, V1 : V> Map<in String, V>.getValue(thisRef: Any?, property: KProperty<*>): V1(source)

Returns the value of the property for the given object from this read-only map.

Since Kotlin

1.0

Return

the property value.

Parameters

thisRef

the object for which the value is requested (not used).

property

the metadata for the property, used to get the name of property and lookup the value corresponding to this name in the map.

Throws

when the map doesn't contain value for the property name and doesn't provide an implicit default (see withDefault).


@JvmName(name = "getVar")
inline operator fun <V, V1 : V> MutableMap<in String, out V>.getValue(thisRef: Any?, property: KProperty<*>): V1(source)

Returns the value of the property for the given object from this mutable map.

Since Kotlin

1.0

Return

the property value.

Parameters

thisRef

the object for which the value is requested (not used).

property

the metadata for the property, used to get the name of property and lookup the value corresponding to this name in the map.

Throws

when the map doesn't contain value for the property name and doesn't provide an implicit default (see withDefault).


fun <K, V> Map<K, V>.getValue(key: K): V(source)

Returns the value for the given key or throws an exception if there is no such key in the map.

If the map was created by withDefault, resorts to its defaultValue provider function instead of throwing an exception.

Since Kotlin

1.1

Throws

when the map doesn't contain a value for the specified key and no implicit default value was provided for that map.