JsonPatchOperation
record JsonPatchOperation(String op, String path, Object value, String from)
源码Source
io/agentscope/core/agui/event/AguiEvent.java:1702–1747承载 JSON Patch Operation数据的记录类型。位于 io.agentscope.core.agui.event 包。核心成员包括 op、path、value、from、add、remove。
Represents a JSON Patch operation (RFC 6902). Used in StateDelta
events for
incremental state updates.
记录组件摘要Record Component Summary
| 组件Component | 类型Type | 说明Description |
|---|---|---|
op | String | 执行 `op` 方法。 Performs the op operation. |
path | String | 执行路径相关操作。 Performs the path operation. |
value | Object | 执行值相关操作。 Performs the value operation. |
from | String | 创建并返回实例。 Creates and returns an instance. |
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public JsonPatchOperation(String op, String path, Object value, String from) | 初始化 `JsonPatchOperation` 实例。 Creates a new instance. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public static JsonPatchOperation add(String path, Object value)static | 执行添加相关操作。 Creates an "add" operation. |
public static JsonPatchOperation remove(String path)static | 设置移除。 Creates a "remove" operation. |
public static JsonPatchOperation replace(String path, Object value)static | 执行 `replace` 方法。 Creates a "replace" operation. |
记录组件详情Record Component Detail
op
String op执行 op 方法。
Performs the op operation.
源码Source
io/agentscope/core/agui/event/AguiEvent.java:1702–1747path
String path执行路径相关操作。
Performs the path operation.
源码Source
io/agentscope/core/agui/event/AguiEvent.java:1702–1747value
Object value执行值相关操作。
Performs the value operation.
源码Source
io/agentscope/core/agui/event/AguiEvent.java:1702–1747from
String from创建并返回实例。
Creates and returns an instance.
源码Source
io/agentscope/core/agui/event/AguiEvent.java:1702–1747构造器详情Constructor Detail
JsonPatchOperation
public JsonPatchOperation(String op, String path, Object value, String from)
初始化 JsonPatchOperation 实例。
Creates a new instance.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
op | String | op(类型 `String`)。The op. |
path | String | 路径(类型 `String`)。The path. |
value | Object | 值(类型 `Object`)。The value. |
from | String | 来自(类型 `String`)。The from. |
源码Source
io/agentscope/core/agui/event/AguiEvent.java:1704–1714方法详情Method Detail
add
public static JsonPatchOperation add(String path, Object value)
static
执行添加相关操作。
Creates an "add" operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
path | String | 路径到添加 at。The path to add at |
value | Object | 值到添加。The value to add |
JsonPatchOperation返回JsonPatchOperation。A new add operation
源码Source
io/agentscope/core/agui/event/AguiEvent.java:1723–1725remove
public static JsonPatchOperation remove(String path)
static
设置移除。
Creates a "remove" operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
path | String | 路径到移除。The path to remove |
JsonPatchOperation返回JsonPatchOperation。A new remove operation
源码Source
io/agentscope/core/agui/event/AguiEvent.java:1733–1735replace
public static JsonPatchOperation replace(String path, Object value)
static
执行 replace 方法。
Creates a "replace" operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
path | String | 路径(类型 `String`)。The path to replace |
value | Object | 新的值。The new value |
JsonPatchOperation返回JsonPatchOperation。A new replace operation
源码Source
io/agentscope/core/agui/event/AguiEvent.java:1744–1746