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 | 规则名称,全局问题时可能为null
message - 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:
  • Constructor Details

  • 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 | 规则名称,可能为null
      message - 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 | 规则名称,可能为null
      message - the message | 消息
      Returns:
      a new warning issue | 新的警告问题
    • toString

      public String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • severity

      public ValidationIssue.Severity severity()
      Returns the value of the severity record component.
      Returns:
      the value of the severity record component
    • type

      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • ruleName

      public String ruleName()
      Returns the value of the ruleName record component.
      Returns:
      the value of the ruleName record component
    • message

      public String message()
      Returns the value of the message record component.
      Returns:
      the value of the message record component