Record Class CsvValidationError

java.lang.Object
java.lang.Record
cloud.opencode.base.csv.validator.CsvValidationError
Record Components:
rowIndex - 0-based data row index | 0起始的数据行索引
column - column name | 列名
value - actual value | 实际值
rule - rule name (e.g. "notBlank", "range[1.0,100.0]") | 规则名称
message - human-readable error message | 人类可读的错误消息

public record CsvValidationError(int rowIndex, String column, String value, String rule, String message) extends Record
CSV Validation Error - Describes a single validation failure CSV验证错误 - 描述单个验证失败

Contains all diagnostic information for a validation error including the row index, column name, actual value, rule name, and a human-readable error message.

包含验证错误的所有诊断信息,包括行索引、列名、实际值、规则名称和 人类可读的错误消息。

Usage Examples | 使用示例:

CsvValidationError error = new CsvValidationError(0, "age", "abc", "range[0.0,120.0]",
    "Value 'abc' in column 'age' is not a valid number");
Since:
JDK 25, opencode-base-csv V1.0.3
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Constructor Details

    • CsvValidationError

      public CsvValidationError(int rowIndex, String column, String value, String rule, String message)
      Creates an instance of a CsvValidationError record class.
      Parameters:
      rowIndex - the value for the rowIndex record component
      column - the value for the column record component
      value - the value for the value record component
      rule - the value for the rule record component
      message - the value for the message record component
  • Method Details

    • toString

      public final 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • rowIndex

      public int rowIndex()
      Returns the value of the rowIndex record component.
      Returns:
      the value of the rowIndex record component
    • column

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

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

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

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