Record Class ValidationResult.ValidationError
java.lang.Object
java.lang.Record
cloud.opencode.base.xml.validate.ValidationResult.ValidationError
- Enclosing class:
ValidationResult
public static record ValidationResult.ValidationError(String message, int line, int column, ValidationResult.ValidationError.Severity severity)
extends Record
Validation Error - Represents a single validation error or warning
验证错误 - 表示单个验证错误或警告
- Since:
- JDK 25, opencode-base-xml V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumError severity levels. -
Constructor Summary
ConstructorsConstructorDescriptionValidationError(String message, int line, int column, ValidationResult.ValidationError.Severity severity) Creates an instance of aValidationErrorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintcolumn()Returns the value of thecolumnrecord component.final booleanIndicates whether some other object is "equal to" this one.intGets the column number.intgetLine()Gets the line number.Gets the message.Gets the severity.final inthashCode()Returns a hash code value for this object.intline()Returns the value of thelinerecord component.message()Returns the value of themessagerecord component.severity()Returns the value of theseverityrecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
ValidationError
public ValidationError(String message, int line, int column, ValidationResult.ValidationError.Severity severity) Creates an instance of aValidationErrorrecord class.- Parameters:
message- the value for themessagerecord componentline- the value for thelinerecord componentcolumn- the value for thecolumnrecord componentseverity- the value for theseverityrecord component
-
-
Method Details
-
getMessage
-
getLine
public int getLine()Gets the line number. 获取行号。- Returns:
- the line number | 行号
-
getColumn
public int getColumn()Gets the column number. 获取列号。- Returns:
- the column number | 列号
-
getSeverity
Gets the severity. 获取严重级别。- Returns:
- the severity | 严重级别
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
message
Returns the value of themessagerecord component.- Returns:
- the value of the
messagerecord component
-
line
public int line()Returns the value of thelinerecord component.- Returns:
- the value of the
linerecord component
-
column
public int column()Returns the value of thecolumnrecord component.- Returns:
- the value of the
columnrecord component
-
severity
Returns the value of theseverityrecord component.- Returns:
- the value of the
severityrecord component
-