ScopeContext

作用域上下文,提供部分贯穿事件的作用域参数信息。

Functions

Link copied to clipboard
abstract fun <T : Any> computeIfAbsent(attribute: Attribute<T>, mappingFunction: (Attribute<T>) -> T): T

如果不存在,则计算并存入。

Link copied to clipboard
abstract fun <T : Any> computeIfPresent(attribute: Attribute<T>, remappingFunction: (Attribute<T>, T) -> T?): T?

如果存在,则计算。如果计算函数中返回null,则为移除对应结果。

Link copied to clipboard
abstract operator fun <T : Any> contains(attribute: Attribute<T>): Boolean

判断是否存在对应键名与类型的键。

Link copied to clipboard
abstract operator fun <T : Any> get(attribute: Attribute<T>): T?

通过 attribute 得到对应的数据。

Link copied to clipboard
open override fun <T : Any> getAttribute(attribute: Attribute<T>): T?

获取指定值。

Link copied to clipboard
abstract fun <T : Any> merge(attribute: Attribute<T>, value: T, remapping: (T, T) -> T): T

存入值,当值已经存在的时候进行合并处理。

Link copied to clipboard
abstract fun <T : Any> put(attribute: Attribute<T>, value: T): T?

存入一个值。

Link copied to clipboard
abstract fun <T : Any> remove(attribute: Attribute<T>): T?

移除对应键名的值。

Link copied to clipboard
abstract fun size(): Int

数量

Inheritors

Link copied to clipboard
Link copied to clipboard

Extensions

Link copied to clipboard
operator fun <T : Any> MutableAttributeMap.set(attribute: Attribute<T>, value: T)