Record Class ValidationReport
java.lang.Object
java.lang.Record
cloud.opencode.base.rules.validation.ValidationReport
- Record Components:
issues- the list of validation issues | 验证问题列表
Validation Report - Aggregated Result of Rule Set Validation
验证报告 - 规则集验证的聚合结果
Collects all validation issues found during rule validation and provides convenience methods for querying errors, warnings, and overall validity.
收集规则验证期间发现的所有验证问题,并提供便捷方法查询错误、警告和整体有效性。
- Since:
- JDK 25, opencode-base-rules V1.0.3
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionValidationReport(List<ValidationIssue> issues) Creates a validation report with a defensive copy of the issues list 使用问题列表的防御性副本创建验证报告 -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.errors()Returns only ERROR-level issues 仅返回ERROR级别的问题booleanChecks whether any ERROR-level issues exist 检查是否存在ERROR级别的问题final inthashCode()Returns a hash code value for this object.booleanChecks whether any WARNING-level issues exist 检查是否存在WARNING级别的问题intReturns the total number of issues 返回问题总数issues()Returns the value of theissuesrecord component.booleanisValid()Checks whether the rule set is valid (no ERROR-level issues) 检查规则集是否有效(没有ERROR级别的问题)toString()Returns a string representation of this record class.static ValidationReportvalid()Returns a valid report with no issues 返回没有问题的有效报告warnings()Returns only WARNING-level issues 仅返回WARNING级别的问题
-
Constructor Details
-
ValidationReport
Creates a validation report with a defensive copy of the issues list 使用问题列表的防御性副本创建验证报告- Parameters:
issues- the validation issues | 验证问题
-
-
Method Details
-
valid
Returns a valid report with no issues 返回没有问题的有效报告- Returns:
- an empty valid report | 空的有效报告
-
isValid
public boolean isValid()Checks whether the rule set is valid (no ERROR-level issues) 检查规则集是否有效(没有ERROR级别的问题)- Returns:
- true if no errors exist | 如果没有错误返回true
-
hasWarnings
public boolean hasWarnings()Checks whether any WARNING-level issues exist 检查是否存在WARNING级别的问题- Returns:
- true if warnings exist | 如果存在警告返回true
-
hasErrors
public boolean hasErrors()Checks whether any ERROR-level issues exist 检查是否存在ERROR级别的问题- Returns:
- true if errors exist | 如果存在错误返回true
-
errors
Returns only ERROR-level issues 仅返回ERROR级别的问题- Returns:
- list of error issues | 错误问题列表
-
warnings
Returns only WARNING-level issues 仅返回WARNING级别的问题- Returns:
- list of warning issues | 警告问题列表
-
issueCount
public int issueCount()Returns the total number of issues 返回问题总数- Returns:
- issue count | 问题数量
-
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). -
issues
-