PropertyAware

interface PropertyAware<V>

具备属性感知的接口。

该接口定义了通用的属性管理能力,允许对象动态地维护一组键值对形式的属性。 实现该接口的类可以像操作 Map 一样添加、获取和移除属性。

Author

M8Test, [email protected], https://m8test.com

Parameters

V

属性值的类型。

Inheritors

Functions

Link copied to clipboard
abstract fun addProperty(key: String, value: V, override: Boolean): Result

添加一个属性。

Link copied to clipboard
abstract fun getProperties(): Map<String, V>

获取当前持有的所有属性。

Link copied to clipboard
abstract fun getProperty(key: String): V?

获取指定名称的属性值。

Link copied to clipboard
abstract fun removeProperty(key: String): Result

移除指定名称的属性。