Package com.tnsai.agents.validation
Record Class ValidationReport
java.lang.Object
java.lang.Record
com.tnsai.agents.validation.ValidationReport
public record ValidationReport(List<ValidationIssue> errors, List<ValidationIssue> warnings, List<ValidationIssue> infos, Duration checkDuration)
extends Record
Aggregate output of
AgentBuilder.build() pre-flight validation
(issue #85). Carries every detected error + warning + info, plus the
total time the validation pipeline took.
Why all-at-once instead of throw-on-first: a misconfigured agent usually has more than one problem (no LLM + tools require approval + resilience config inconsistent). Surfacing them together lets the user fix the whole picture in one pass; throw-on-first turns this into N fix-and-retry round trips.
- Since:
- 0.5.0 (issue #85)
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionValidationReport(List<ValidationIssue> errors, List<ValidationIssue> warnings, List<ValidationIssue> infos, Duration checkDuration) Creates an instance of aValidationReportrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic ValidationReport.Builderbuilder()Returns a builder that bins issues by severity automatically as they're added.Returns the value of thecheckDurationrecord component.final booleanIndicates whether some other object is "equal to" this one.errors()Returns the value of theerrorsrecord component.booleanfinal inthashCode()Returns a hash code value for this object.booleaninfos()Returns the value of theinfosrecord component.voidThrowsAgentValidationExceptionif any errors were collected.final StringtoString()Returns a string representation of this record class.warnings()Returns the value of thewarningsrecord component.
-
Constructor Details
-
ValidationReport
public ValidationReport(List<ValidationIssue> errors, List<ValidationIssue> warnings, List<ValidationIssue> infos, Duration checkDuration) Creates an instance of aValidationReportrecord class.- Parameters:
errors- the value for theerrorsrecord componentwarnings- the value for thewarningsrecord componentinfos- the value for theinfosrecord componentcheckDuration- the value for thecheckDurationrecord component
-
-
Method Details
-
hasErrors
public boolean hasErrors() -
hasWarnings
public boolean hasWarnings() -
throwIfErrors
public void throwIfErrors()ThrowsAgentValidationExceptionif any errors were collected. -
builder
Returns a builder that bins issues by severity automatically as they're added. -
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). -
errors
Returns the value of theerrorsrecord component.- Returns:
- the value of the
errorsrecord component
-
warnings
Returns the value of thewarningsrecord component.- Returns:
- the value of the
warningsrecord component
-
infos
Returns the value of theinfosrecord component.- Returns:
- the value of the
infosrecord component
-
checkDuration
Returns the value of thecheckDurationrecord component.- Returns:
- the value of the
checkDurationrecord component
-