Record Class TreeResult.Validation<T>
java.lang.Object
java.lang.Record
cloud.opencode.base.tree.result.TreeResult.Validation<T>
- Type Parameters:
T- the data type | 数据类型- Record Components:
violations- the list of violations | 违规列表
- All Implemented Interfaces:
TreeResult<T>
- Enclosing interface:
TreeResult<T>
public static record TreeResult.Validation<T>(List<TreeResult.Violation> violations)
extends Record
implements TreeResult<T>
Validation Result
验证结果
Represents a validation failure with violation details.
表示带违规详情的验证失败。
- Since:
- JDK 25, opencode-base-tree V1.0.0
- Author:
- Leon Soo
-
Nested Class Summary
Nested classes/interfaces inherited from interface TreeResult
TreeResult.Empty<T>, TreeResult.Failure<T>, TreeResult.Success<T>, TreeResult.Validation<T>, TreeResult.Violation -
Constructor Summary
ConstructorsConstructorDescriptionValidation(List<TreeResult.Violation> violations) Compact constructor 紧凑构造函数 -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Get the combined error message 获取组合错误消息Get error violations 获取错误违规intGet the violation count 获取违规数量Get violations by severity 按严重程度获取违规Get warning violations 获取警告违规final inthashCode()Returns a hash code value for this object.booleanCheck if has violations 检查是否有违规toString()Returns a string representation of this record class.Returns the value of theviolationsrecord component.Methods inherited from interface TreeResult
flatMap, fold, getOrElse, getOrElseGet, getOrNull, getOrThrow, getOrThrow, isEmpty, isFailed, isSuccess, isValidation, map, onEmpty, onFailure, onSuccess, onValidation, recover, recoverWith, toOptional
-
Constructor Details
-
Validation
Compact constructor 紧凑构造函数
-
-
Method Details
-
getViolationCount
public int getViolationCount()Get the violation count 获取违规数量- Returns:
- the violation count | 违规数量
-
hasViolations
public boolean hasViolations()Check if has violations 检查是否有违规- Returns:
- true if has violations | 如果有违规返回true
-
getViolationsBySeverity
Get violations by severity 按严重程度获取违规- Parameters:
severity- the severity level | 严重程度- Returns:
- the violations with the severity | 具有该严重程度的违规列表
-
getErrors
Get error violations 获取错误违规- Returns:
- the error violations | 错误违规列表
-
getWarnings
Get warning violations 获取警告违规- Returns:
- the warning violations | 警告违规列表
-
getCombinedMessage
Get the combined error message 获取组合错误消息- Returns:
- the combined message | 组合消息
-
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). -
violations
Returns the value of theviolationsrecord component.- Returns:
- the value of the
violationsrecord component
-