ValidationResult
class ValidationResult
源码Source
io/agentscope/core/tool/coding/CommandValidator.java:154–184命令校验的结果。位于 io.agentscope.core.tool.coding 包。核心成员包括 isAllowed、getReason、getExecutable、allowed、rejected、ValidationResult。
Result of command validation.
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public ValidationResult(boolean allowed, String reason, String executable) | 初始化 `ValidationResult` 实例。 Creates a new instance. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public boolean isAllowed() | 判断是否已允许。 Returns whether the allowed. |
public String getReason() | 获取推理。 Returns the reason. |
public String getExecutable() | 获取 `getExecutable`。 Returns the executable. |
public static ValidationResult allowed(String executable)static | 设置已允许。 Performs the allowed operation. |
public static ValidationResult rejected(String reason, String executable)static | 执行已拒绝相关操作。 Performs the rejected operation. |
构造器详情Constructor Detail
ValidationResult
public ValidationResult(boolean allowed, String reason, String executable)
初始化 ValidationResult 实例。
Creates a new instance.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
allowed | boolean | 已允许(类型 `boolean`)。The allowed. |
reason | String | 原因(类型 `String`)。The reason. |
executable | String | executable(类型 `String`)。The executable. |
源码Source
io/agentscope/core/tool/coding/CommandValidator.java:159–163方法详情Method Detail
isAllowed
public boolean isAllowed()
判断是否已允许。
Returns whether the allowed.
boolean返回布尔值,表示判断结果。Returns a boolean result.
源码Source
io/agentscope/core/tool/coding/CommandValidator.java:165–167getReason
public String getReason()
获取推理。
Returns the reason.
String返回字符串结果。Returns a string.
源码Source
io/agentscope/core/tool/coding/CommandValidator.java:169–171getExecutable
public String getExecutable()
获取 getExecutable。
Returns the executable.
String返回字符串结果。Returns a string.
源码Source
io/agentscope/core/tool/coding/CommandValidator.java:173–175allowed
public static ValidationResult allowed(String executable)
static
设置已允许。
Performs the allowed operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
executable | String | executable(类型 `String`)。The executable. |
ValidationResult返回ValidationResult。Returns validation result.
源码Source
io/agentscope/core/tool/coding/CommandValidator.java:177–179rejected
public static ValidationResult rejected(String reason, String executable)
static
执行已拒绝相关操作。
Performs the rejected operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
reason | String | 原因(类型 `String`)。The reason. |
executable | String | executable(类型 `String`)。The executable. |
ValidationResult返回ValidationResult。Returns validation result.
源码Source
io/agentscope/core/tool/coding/CommandValidator.java:181–183