kite-core / jp.co.cyberagent.kite.core / MutableKiteContext
MutableKiteContext¶
interface MutableKiteContext :
KiteContext
A modifiable KiteContext.
Inherited Properties¶
Name | Summary |
---|---|
keys | abstract val keys: Set < Any > Returns all keys in this context. |
Functions¶
Name | Summary |
---|---|
set | abstract operator fun <T : Any > set(key: Any , value: T ): Unit Associates the value. If the key already existed then throws IllegalStateException. |
Inherited Functions¶
Name | Summary |
---|---|
get | abstract operator fun <T : Any > get(key: Any ): T ? Returns the value with the given key. If the key is not found then returns null. |
plus | open operator fun plus(kiteContext: KiteContext ): KiteContext Returns a context containing value from this context and values from other kiteContext. The elements from this context with the same key as in the other one are dropped. |
Extension Functions¶
Name | Summary |
---|---|
asKiteContextElement | fun <T : Any > T .asKiteContextElement(): Pair < KClass <*>, Any > Creates a KiteContextElement with the KClass |
getByType | fun <T : Any > KiteContext .getByType(): T ? Returns the value with its KClass as the key. If the key is not found then returns null. |
plusAssign | operator fun MutableKiteContext .plusAssign(element: KiteContextElement ): Unit Associates the key of element with its value. If the key already existed then throws IllegalStateException |
require | fun <T : Any > KiteContext .require(key: Any ): T Returns the value with the given key. If the key is not found then throws IllegalArgumentException. |
requireByType | fun <T : Any > KiteContext .requireByType(): T Returns the value with its KClass as the key. If the key is not found then throws IllegalArgumentException. |
setByType | fun <T : Any > MutableKiteContext .setByType(value: T ): Unit Associates the value with its KClass as the key. If the key already existed then throws IllegalStateException. |