Record Class ValidationIssue
java.lang.Object
java.lang.Record
cloud.opencode.base.rules.validation.ValidationIssue
- Record Components:
severity- the severity of the issue | 问题的严重程度type- the type of issue | 问题类型ruleName- the name of the rule, may be null for global issues | 规则名称,全局问题时可能为nullmessage- the human-readable message | 人类可读的消息
public record ValidationIssue(ValidationIssue.Severity severity, ValidationIssue.IssueType type, String ruleName, String message)
extends Record
Validation Issue - Represents a Single Problem Found During Rule Validation
验证问题 - 表示规则验证期间发现的单个问题
Encapsulates the severity, type, rule name, and message of a validation issue. Issues can be errors (blocking) or warnings (informational).
封装验证问题的严重程度、类型、规则名称和消息。 问题可以是错误(阻塞性)或警告(信息性)。
- Since:
- JDK 25, opencode-base-rules V1.0.3
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumType of Validation Issue 验证问题类型static enumSeverity Level of a Validation Issue 验证问题的严重级别 -
Constructor Summary
ConstructorsConstructorDescriptionValidationIssue(ValidationIssue.Severity severity, ValidationIssue.IssueType type, String ruleName, String message) Creates an instance of aValidationIssuerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static ValidationIssueerror(ValidationIssue.IssueType type, String ruleName, String message) Creates an ERROR-level validation issue 创建ERROR级别的验证问题final inthashCode()Returns a hash code value for this object.message()Returns the value of themessagerecord component.ruleName()Returns the value of theruleNamerecord component.severity()Returns the value of theseverityrecord component.toString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.static ValidationIssuewarning(ValidationIssue.IssueType type, String ruleName, String message) Creates a WARNING-level validation issue 创建WARNING级别的验证问题
-
Constructor Details
-
ValidationIssue
public ValidationIssue(ValidationIssue.Severity severity, ValidationIssue.IssueType type, String ruleName, String message) Creates an instance of aValidationIssuerecord class.
-
-
Method Details
-
error
public static ValidationIssue error(ValidationIssue.IssueType type, String ruleName, String message) Creates an ERROR-level validation issue 创建ERROR级别的验证问题- Parameters:
type- the issue type | 问题类型ruleName- the rule name, may be null | 规则名称,可能为nullmessage- the message | 消息- Returns:
- a new error issue | 新的错误问题
-
warning
public static ValidationIssue warning(ValidationIssue.IssueType type, String ruleName, String message) Creates a WARNING-level validation issue 创建WARNING级别的验证问题- Parameters:
type- the issue type | 问题类型ruleName- the rule name, may be null | 规则名称,可能为nullmessage- the message | 消息- Returns:
- a new warning issue | 新的警告问题
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
severity
-
type
-
ruleName
-
message
-