Package com.tnsai.evaluation.model
Record Class TestDataset
java.lang.Object
java.lang.Record
com.tnsai.evaluation.model.TestDataset
public record TestDataset(String name, String description, String version, List<TestCase> cases)
extends Record
A collection of test cases for benchmarking.
Supports loading from JSON files or classpath resources.
- Since:
- 0.1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncases()Returns the value of thecasesrecord component.Returns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.filterByTag(String tag) Filters test cases by tag.static TestDatasetfromClasspath(String resource) Loads a dataset from classpath.static TestDatasetLoads a dataset from a JSON file.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.intsize()Returns number of test cases.final StringtoString()Returns a string representation of this record class.version()Returns the value of theversionrecord component.
-
Constructor Details
-
TestDataset
Creates an instance of aTestDatasetrecord class.- Parameters:
name- the value for thenamerecord componentdescription- the value for thedescriptionrecord componentversion- the value for theversionrecord componentcases- the value for thecasesrecord component
-
-
Method Details
-
fromFile
Loads a dataset from a JSON file.- Throws:
IOException
-
fromClasspath
Loads a dataset from classpath.- Throws:
IOException
-
filterByTag
Filters test cases by tag. -
size
public int size()Returns number of test cases. -
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). -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
version
Returns the value of theversionrecord component.- Returns:
- the value of the
versionrecord component
-
cases
Returns the value of thecasesrecord component.- Returns:
- the value of the
casesrecord component
-