rd-framework / com.jetbrains.rd.framework.base / IPerContextMap

IPerContextMap

interface IPerContextMap<K : Any, out V : Any> : IRdDynamic

A collection that automatically maps values to keys from RdContext's value set Key-value pairs in this map are automatically managed based on possible values of RdContext

As context value sets are protocol-specific, this map will behave differently depending on whether or not it's bound to a com.jetbrains.rd.framework.IProtocol An unbound map will automatically create mappings for all context values it's accessed with. When a map is bound later, all values not present in protocol value set will be silently dropped.

See Also

com.jetbrains.rd.framework.impl.ProtocolContexts.getValueSet

Properties

context

abstract val context: RdContext<K>

The context that is used by this map. Must be heavy.

Inherited Properties

location

abstract val location: <ERROR CLASS>

protocol

abstract val protocol: IProtocol

serializationContext

abstract val serializationContext: SerializationCtx

Functions

get

abstract operator fun get(key: K): V?

Gets the value associated with specified context value, or null if none is associated When this map is not bound, this will automatically create a new mapping instead of returning null

getForCurrentContext

abstract fun getForCurrentContext(): V

Gets the value associated with current context value, equivalent to get(context.value) If the context doesn't have a value set, or contexts's protocol value set does not contain the current context value, this will throw an exception

Extension Functions

deepClonePolymorphic

fun <T> T.deepClonePolymorphic(): T

Inheritors

RdPerContextMap

class RdPerContextMap<K : Any, V : RdBindableBase> : RdReactiveBase, IPerContextMap<K, V>