Record Class ValidationSummary

java.lang.Object
java.lang.Record
ai.timefold.solver.service.definition.internal.events.ValidationSummary

public record ValidationSummary(ValidationStatus status, Integer errorCount, Integer warningCount, Map<String,Integer> errorCountsByCode, Map<String,Integer> warningCountsByCode) extends Record
A compact summary of a dataset validation, carrying the overall ValidationStatus and issue counts by IssueCode split by severity.

When the model does not support validation, status is ValidationStatus.VALIDATION_NOT_SUPPORTED and the counts are null, so they can be omitted downstream rather than reported as zero.

  • Constructor Details

    • ValidationSummary

      public ValidationSummary(ValidationStatus status, Integer errorCount, Integer warningCount, Map<String,Integer> errorCountsByCode, Map<String,Integer> warningCountsByCode)
      Creates an instance of a ValidationSummary record class.
      Parameters:
      status - the value for the status record component
      errorCount - the value for the errorCount record component
      warningCount - the value for the warningCount record component
      errorCountsByCode - the value for the errorCountsByCode record component
      warningCountsByCode - the value for the warningCountsByCode record component
  • Method Details

    • of

      public static ValidationSummary of(ValidationResult<?> validationResult)
    • 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.
    • status

      public ValidationStatus status()
      Returns the value of the status record component.
      Returns:
      the value of the status record component
    • errorCount

      public Integer errorCount()
      Returns the value of the errorCount record component.
      Returns:
      the value of the errorCount record component
    • warningCount

      public Integer warningCount()
      Returns the value of the warningCount record component.
      Returns:
      the value of the warningCount record component
    • errorCountsByCode

      public Map<String,Integer> errorCountsByCode()
      Returns the value of the errorCountsByCode record component.
      Returns:
      the value of the errorCountsByCode record component
    • warningCountsByCode

      public Map<String,Integer> warningCountsByCode()
      Returns the value of the warningCountsByCode record component.
      Returns:
      the value of the warningCountsByCode record component