Record Class ValidationIssue
java.lang.Object
java.lang.Record
dev.jcputney.elearning.parser.validation.ValidationIssue
public record ValidationIssue(ValidationIssue.Severity severity, String code, String message, String location, String suggestedFix)
extends Record
Represents a single validation issue found during module parsing. Immutable record containing
severity, error code, message, location, and optional suggestion.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumSeverity levels for validation issues. -
Constructor Summary
ConstructorsConstructorDescriptionValidationIssue(ValidationIssue.Severity severity, String code, String message, String location, String suggestedFix) Creates an instance of aValidationIssuerecord class. -
Method Summary
Modifier and TypeMethodDescriptioncode()Returns the value of thecoderecord component.final booleanIndicates whether some other object is "equal to" this one.static ValidationIssueCreates an error-level validation issue without a suggested fix.static ValidationIssueCreates an error-level validation issue with a suggested fix.final inthashCode()Returns a hash code value for this object.location()Returns the value of thelocationrecord component.message()Returns the value of themessagerecord component.severity()Returns the value of theseverityrecord component.Returns the value of thesuggestedFixrecord component.final StringtoString()Returns a string representation of this record class.static ValidationIssueCreates a warning-level validation issue without a suggested fix.static ValidationIssueCreates a warning-level validation issue with a suggested fix.
-
Constructor Details
-
ValidationIssue
public ValidationIssue(ValidationIssue.Severity severity, String code, String message, String location, String suggestedFix) Creates an instance of aValidationIssuerecord class.- Parameters:
severity- the value for theseverityrecord componentcode- the value for thecoderecord componentmessage- the value for themessagerecord componentlocation- the value for thelocationrecord componentsuggestedFix- the value for thesuggestedFixrecord component
-
-
Method Details
-
error
Creates an error-level validation issue without a suggested fix.- Parameters:
code- Error code (e.g., "SCORM12_MISSING_RESOURCE_REF")message- Human-readable error messagelocation- Location context (e.g., XPath or file location)- Returns:
- ValidationIssue with ERROR severity
-
error
public static ValidationIssue error(String code, String message, String location, String suggestedFix) Creates an error-level validation issue with a suggested fix.- Parameters:
code- Error code (e.g., "SCORM12_MISSING_RESOURCE_REF")message- Human-readable error messagelocation- Location context (e.g., XPath or file location)suggestedFix- Suggested fix for the issue- Returns:
- ValidationIssue with ERROR severity
-
warning
Creates a warning-level validation issue without a suggested fix.- Parameters:
code- Warning codemessage- Human-readable warning messagelocation- Location context- Returns:
- ValidationIssue with WARNING severity
-
warning
public static ValidationIssue warning(String code, String message, String location, String suggestedFix) Creates a warning-level validation issue with a suggested fix.- Parameters:
code- Warning codemessage- Human-readable warning messagelocation- Location contextsuggestedFix- Suggested fix for the issue- Returns:
- ValidationIssue with WARNING severity
-
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. -
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. -
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). -
severity
Returns the value of theseverityrecord component.- Returns:
- the value of the
severityrecord component
-
code
Returns the value of thecoderecord component.- Returns:
- the value of the
coderecord component
-
message
Returns the value of themessagerecord component.- Returns:
- the value of the
messagerecord component
-
location
Returns the value of thelocationrecord component.- Returns:
- the value of the
locationrecord component
-
suggestedFix
Returns the value of thesuggestedFixrecord component.- Returns:
- the value of the
suggestedFixrecord component
-