Record Class ScoreResult
java.lang.Object
java.lang.Record
cloud.opencode.base.rules.score.ScoreResult
- Record Components:
totalScore- the aggregated total score | 聚合总分ruleScores- per-rule scores (rule name to score) | 各规则分数(规则名称到分数)strategy- the aggregation strategy used | 使用的聚合策略
public record ScoreResult(double totalScore, Map<String,Double> ruleScores, AggregationStrategy strategy)
extends Record
Score Result - Aggregated Scoring Outcome from a Scoring Engine Run
评分结果 - 评分引擎运行的聚合评分结果
Contains the total aggregated score, individual per-rule scores, and the aggregation strategy used.
包含总聚合分数、各规则的单独分数以及使用的聚合策略。
- Since:
- JDK 25, opencode-base-rules V1.0.3
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionScoreResult(double totalScore, Map<String, Double> ruleScores, AggregationStrategy strategy) Creates a ScoreResult with a defensive copy of the rule scores map 使用规则分数映射的防御性副本创建ScoreResult -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the number of rules that matched (scored) 返回匹配(评分)的规则数量Returns the value of theruleScoresrecord component.strategy()Returns the value of thestrategyrecord component.Returns the name of the rule with the highest score 返回得分最高的规则名称final StringtoString()Returns a string representation of this record class.doubleReturns the value of thetotalScorerecord component.
-
Constructor Details
-
ScoreResult
Creates a ScoreResult with a defensive copy of the rule scores map 使用规则分数映射的防御性副本创建ScoreResult- Parameters:
totalScore- the total score | 总分ruleScores- the per-rule scores | 各规则分数strategy- the aggregation strategy | 聚合策略
-
-
Method Details
-
matchCount
public int matchCount()Returns the number of rules that matched (scored) 返回匹配(评分)的规则数量- Returns:
- match count | 匹配数量
-
topScoringRule
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
totalScore
public double totalScore()Returns the value of thetotalScorerecord component.- Returns:
- the value of the
totalScorerecord component
-
ruleScores
Returns the value of theruleScoresrecord component.- Returns:
- the value of the
ruleScoresrecord component
-
strategy
-