Mapping
public abstract class Mapping
源码Source
io/agentscope/runtime/common/collections/Mapping.java:24–55Mapping,承载智能体的部署、调度与服务化运行。位于 io.agentscope.runtime.common.collections 包。核心成员包括 set、get、delete、scan。
Abstract base class for key-value mapping implementations.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public abstract void set(String key, Object value)abstract | 执行设置相关操作。 Sets a key-value pair. |
public abstract Object get(String key)abstract | 获取值用于密钥。 Gets the value for a key. |
public abstract void delete(String key)abstract | 删除数据。 Deletes a key-value pair. |
public abstract List<String> scan(String prefix)abstract | 设置该参数。 Scans for keys with the given prefix. |
方法详情Method Detail
set
public abstract void set(String key, Object value)
abstract
执行设置相关操作。
Sets a key-value pair.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
key | String | 密钥。The key |
value | Object | 值(as 映射)。The value (as a Map) |
源码Source
io/agentscope/runtime/common/collections/Mapping.java:31get
public abstract Object get(String key)
abstract
获取值用于密钥。
Gets the value for a key.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
key | String | 密钥。The key |
Object返回对象。The value, or null if not found
源码Source
io/agentscope/runtime/common/collections/Mapping.java:39delete
public abstract void delete(String key)
abstract
删除数据。
Deletes a key-value pair.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
key | String | 密钥到删除。The key to delete |
源码Source
io/agentscope/runtime/common/collections/Mapping.java:46scan
public abstract List<String> scan(String prefix)
abstract
设置该参数。
Scans for keys with the given prefix.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
prefix | String | prefix(类型 `String`)。The prefix to match |
List<String>返回列出。List of matching keys
源码Source
io/agentscope/runtime/common/collections/Mapping.java:54