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)
  • Constructor Details

    • ValidationReport

      public ValidationReport(List<ValidationIssue> errors, List<ValidationIssue> warnings, List<ValidationIssue> infos, Duration checkDuration)
      Creates an instance of a ValidationReport record class.
      Parameters:
      errors - the value for the errors record component
      warnings - the value for the warnings record component
      infos - the value for the infos record component
      checkDuration - the value for the checkDuration record component
  • Method Details

    • hasErrors

      public boolean hasErrors()
    • hasWarnings

      public boolean hasWarnings()
    • throwIfErrors

      public void throwIfErrors()
      Throws AgentValidationException if any errors were collected.
    • builder

      public static ValidationReport.Builder builder()
      Returns a builder that bins issues by severity automatically as they're added.
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • errors

      public List<ValidationIssue> errors()
      Returns the value of the errors record component.
      Returns:
      the value of the errors record component
    • warnings

      public List<ValidationIssue> warnings()
      Returns the value of the warnings record component.
      Returns:
      the value of the warnings record component
    • infos

      public List<ValidationIssue> infos()
      Returns the value of the infos record component.
      Returns:
      the value of the infos record component
    • checkDuration

      public Duration checkDuration()
      Returns the value of the checkDuration record component.
      Returns:
      the value of the checkDuration record component