Record Class Explanation

java.lang.Object
java.lang.Record
cloud.opencode.base.rules.explain.Explanation
Record Components:
summary - overall summary of the execution | 执行的总体摘要
details - per-rule explanations | 每个规则的解释

public record Explanation(String summary, List<RuleExplanation> details) extends Record
Explanation - Complete Explanation of a Rule Engine Execution 解释 - 规则引擎执行的完整解释

Aggregates individual rule explanations with an overall summary.

聚合单个规则解释和总体摘要。

Since:
JDK 25, opencode-base-rules V1.0.3
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Constructor Details

    • Explanation

      public Explanation(String summary, List<RuleExplanation> details)
      Canonical constructor with validation 带验证的规范构造函数
      Parameters:
      summary - overall summary | 总体摘要
      details - per-rule explanations | 每个规则的解释
  • Method Details

    • firedCount

      public int firedCount()
      Returns the count of rules that fired 返回已触发规则的数量
      Returns:
      fired rule count | 已触发规则的数量
    • totalCount

      public int totalCount()
      Returns the total number of rules 返回规则的总数
      Returns:
      total rule count | 规则总数
    • toString

      public String toString()
      Returns a formatted multi-line string representation 返回格式化的多行字符串表示
      Specified by:
      toString in class Record
      Returns:
      formatted explanation | 格式化的解释
    • 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.
    • summary

      public String summary()
      Returns the value of the summary record component.
      Returns:
      the value of the summary record component
    • details

      public List<RuleExplanation> details()
      Returns the value of the details record component.
      Returns:
      the value of the details record component