Package com.tnsai.evaluation.model
Record Class EvaluationResult
java.lang.Object
java.lang.Record
com.tnsai.evaluation.model.EvaluationResult
public record EvaluationResult(String evaluatorName, double score, String details, Map<String,Double> metrics, Instant timestamp)
extends Record
Result of a single evaluation. Contains a normalized score [0.0, 1.0],
human-readable details, and arbitrary metrics for drill-down.
- Since:
- 0.1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondetails()Returns the value of thedetailsrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theevaluatorNamerecord component.static EvaluationResultCreates a simple fail result.final inthashCode()Returns a hash code value for this object.metrics()Returns the value of themetricsrecord component.static EvaluationResultCreates a result with current timestamp.static EvaluationResultCreates a simple pass/fail result.booleanpassed(double threshold) doublescore()Returns the value of thescorerecord component.Returns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
EvaluationResult
public EvaluationResult(String evaluatorName, double score, String details, Map<String, Double> metrics, Instant timestamp) Creates an instance of aEvaluationResultrecord class.- Parameters:
evaluatorName- the value for theevaluatorNamerecord componentscore- the value for thescorerecord componentdetails- the value for thedetailsrecord componentmetrics- the value for themetricsrecord componenttimestamp- the value for thetimestamprecord component
-
-
Method Details
-
of
public static EvaluationResult of(String evaluatorName, double score, String details, Map<String, Double> metrics) Creates a result with current timestamp. -
pass
Creates a simple pass/fail result. -
fail
Creates a simple fail result. -
passed
public boolean passed(double threshold) -
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. -
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. -
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 '=='. -
evaluatorName
Returns the value of theevaluatorNamerecord component.- Returns:
- the value of the
evaluatorNamerecord component
-
score
public double score()Returns the value of thescorerecord component.- Returns:
- the value of the
scorerecord component
-
details
Returns the value of thedetailsrecord component.- Returns:
- the value of the
detailsrecord component
-
metrics
Returns the value of themetricsrecord component.- Returns:
- the value of the
metricsrecord component
-
timestamp
Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-