Package dev.dokimos.core
Record Class EvalTestCase
java.lang.Object
java.lang.Record
dev.dokimos.core.EvalTestCase
- Record Components:
inputs- the inputs provided to the system under testactualOutputs- the outputs produced by the systemexpectedOutputs- the expected outputs for comparisonmetadata- additional metadata about the test case
public record EvalTestCase(Map<String,Object> inputs, Map<String,Object> actualOutputs, Map<String,Object> expectedOutputs, Map<String,Object> metadata)
extends Record
A test case for evaluation.
Contains inputs provided to the system, actual outputs produced by the system, optional expected outputs for comparison, and additional metadata.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for constructing test cases with multiple inputs and outputs. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the primary actual output value.Returns the value of theactualOutputsrecord component.static EvalTestCase.Builderbuilder()Creates a new builder for constructing test cases.final booleanIndicates whether some other object is "equal to" this one.Gets the primary expected output value.Returns the value of theexpectedOutputsrecord component.final inthashCode()Returns a hash code value for this object.input()Gets the primary input value.inputs()Returns the value of theinputsrecord component.metadata()Returns the value of themetadatarecord component.static EvalTestCaseCreates a test case with a single input and actual output.static EvalTestCaseCreates a test case with input, actual output, and expected output.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
EvalTestCase
public EvalTestCase(Map<String, Object> inputs, Map<String, Object> actualOutputs, Map<String, Object> expectedOutputs, Map<String, Object> metadata) Creates an instance of aEvalTestCaserecord class.- Parameters:
inputs- the value for theinputsrecord componentactualOutputs- the value for theactualOutputsrecord componentexpectedOutputs- the value for theexpectedOutputsrecord componentmetadata- the value for themetadatarecord component
-
-
Method Details
-
of
Creates a test case with a single input and actual output.- Parameters:
input- the input valueactualOutput- the actual output value- Returns:
- a new test case
-
of
Creates a test case with input, actual output, and expected output.- Parameters:
input- the input valueactualOutput- the actual output valueexpectedOutput- the expected output value- Returns:
- a new test case
-
builder
Creates a new builder for constructing test cases.- Returns:
- a new builder
-
input
Gets the primary input value.- Returns:
- the input value or null if not present
-
actualOutput
Gets the primary actual output value.- Returns:
- the actual output value or null if not present
-
expectedOutput
Gets the primary expected output value.- Returns:
- the expected output value or null if not present
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
inputs
Returns the value of theinputsrecord component.- Returns:
- the value of the
inputsrecord component
-
actualOutputs
Returns the value of theactualOutputsrecord component.- Returns:
- the value of the
actualOutputsrecord component
-
expectedOutputs
Returns the value of theexpectedOutputsrecord component.- Returns:
- the value of the
expectedOutputsrecord component
-
metadata
Returns the value of themetadatarecord component.- Returns:
- the value of the
metadatarecord component
-