Record Class FailureCluster

java.lang.Object
java.lang.Record
com.tnsai.evaluation.autoharness.FailureCluster
Record Components:
clusterKey - stable identifier for the root cause
cause - human-readable description of the root cause
count - total number of failures in this cluster
examples - representative failure records (may be a subset)

public record FailureCluster(String clusterKey, String cause, int count, List<FailureRecord> examples) extends Record
A group of FailureRecords sharing a common root cause.

The clusterKey is a stable identifier for the root cause (e.g. "NullPointerException:planning") used for deduplication and tracking.

Since:
0.1.0
  • Constructor Details

    • FailureCluster

      public FailureCluster(String clusterKey, String cause, int count, List<FailureRecord> examples)
      Creates an instance of a FailureCluster record class.
      Parameters:
      clusterKey - the value for the clusterKey record component
      cause - the value for the cause record component
      count - the value for the count record component
      examples - the value for the examples record component
  • Method Details

    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • clusterKey

      public String clusterKey()
      Returns the value of the clusterKey record component.
      Returns:
      the value of the clusterKey record component
    • cause

      public String cause()
      Returns the value of the cause record component.
      Returns:
      the value of the cause record component
    • count

      public int count()
      Returns the value of the count record component.
      Returns:
      the value of the count record component
    • examples

      public List<FailureRecord> examples()
      Returns the value of the examples record component.
      Returns:
      the value of the examples record component