Record Class ValidationResult
java.lang.Object
java.lang.Record
io.github.duckasteroid.agentdocs.publish.validation.ValidationResult
- Record Components:
ruleId- stable rule identifierseverity- optional severity for non-pass outcomesdetails- validation details or reasons (empty for pass)
public record ValidationResult(String ruleId, Optional<ValidationSeverity> severity, List<String> details)
extends Record
Result of evaluating a single validation rule.
-
Constructor Summary
ConstructorsConstructorDescriptionValidationResult(String ruleId, Optional<ValidationSeverity> severity, List<String> details) Creates an instance of aValidationResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondetails()Returns the value of thedetailsrecord component.final booleanIndicates whether some other object is "equal to" this one.static ValidationResultCreates an error result.final inthashCode()Returns a hash code value for this object.static ValidationResultCreates a pass result with no severity.ruleId()Returns the value of theruleIdrecord component.severity()Returns the value of theseverityrecord component.final StringtoString()Returns a string representation of this record class.static ValidationResultCreates a warning result.
-
Constructor Details
-
Method Details
-
pass
Creates a pass result with no severity.- Parameters:
ruleId- rule identifier- Returns:
- pass result
-
error
Creates an error result.- Parameters:
ruleId- rule identifierdetail- error detail- Returns:
- error result
-
warn
Creates a warning result.- Parameters:
ruleId- rule identifierdetail- warning detail- Returns:
- warning result
-
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). -
ruleId
Returns the value of theruleIdrecord component.- Returns:
- the value of the
ruleIdrecord component
-
severity
Returns the value of theseverityrecord component.- Returns:
- the value of the
severityrecord component
-
details
Returns the value of thedetailsrecord component.- Returns:
- the value of the
detailsrecord component
-