Record Class RankedCause

java.lang.Object
java.lang.Record
com.shaft.doctor.model.RankedCause
Record Components:
category - cause category this entry ranks
trustPercentage - deterministic trust in the 5-95 range (never 0 or 100; see com.shaft.doctor.analysis.DeterministicTrustScorer)
confidence - rule confidence band backing this cause
rationale - human-readable explanation of how the trust score was computed
evidenceIds - cited evidence identifiers supporting this cause
fixPrompt - self-contained, copy/paste-ready prompt describing the recommended fix

public record RankedCause(CauseCategory category, int trustPercentage, Confidence confidence, String rationale, List<String> evidenceIds, String fixPrompt) extends Record
One ranked candidate root cause emitted alongside the legacy single-primary-cause fields.

Unlike Diagnosis.primaryCause(), which names exactly one supported cause, a diagnosis may carry several RankedCause entries -- including in the case where Doctor deliberately declines to pick a single primary cause because independent evidence supports more than one. Each entry is independently trusted, cited, and actionable.

  • Constructor Details

  • 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 the compare method from their corresponding wrapper classes.
      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.
    • category

      public CauseCategory category()
      Returns the value of the category record component.
      Returns:
      the value of the category record component
    • trustPercentage

      public int trustPercentage()
      Returns the value of the trustPercentage record component.
      Returns:
      the value of the trustPercentage record component
    • confidence

      public Confidence confidence()
      Returns the value of the confidence record component.
      Returns:
      the value of the confidence record component
    • rationale

      public String rationale()
      Returns the value of the rationale record component.
      Returns:
      the value of the rationale record component
    • evidenceIds

      public List<String> evidenceIds()
      Returns the value of the evidenceIds record component.
      Returns:
      the value of the evidenceIds record component
    • fixPrompt

      public String fixPrompt()
      Returns the value of the fixPrompt record component.
      Returns:
      the value of the fixPrompt record component