Record Class TestDefinition

java.lang.Object
java.lang.Record
uno.anahata.asi.yam.tools.benchmarks.TestDefinition
Record Components:
testCode - The unique identifier code for the test (e.g., "JAVA-JNA-1").
title - The descriptive title of the challenge.
rawPrompt - The core task objective delivered to candidate models.
toolkits - The optional list of ToolkitSettings configuring enabled toolkits and their permissions (null for container defaults).

public record TestDefinition(String testCode, String title, String rawPrompt, List<ToolkitSettings> toolkits) extends Record
Immutable descriptor representing a standardized test challenge within a benchmark suite.

Encapsulates the unique test code, human-readable title, raw goal prompt, and optional list of ToolkitSettings. If toolkits is null, the test inherits the container's default tool classes and permissions.

Author:
anahata
  • Field Details

    • testCode

      private final String testCode
      The field for the testCode record component.
    • title

      private final String title
      The field for the title record component.
    • rawPrompt

      private final String rawPrompt
      The field for the rawPrompt record component.
    • toolkits

      private final List<ToolkitSettings> toolkits
      The field for the toolkits record component.
  • Constructor Details

    • TestDefinition

      public TestDefinition(String testCode, String title, String rawPrompt, List<ToolkitSettings> toolkits)
      Canonical constructor preserving null or unmodifiable collection copies.
      Parameters:
      testCode - The unique identifier code.
      title - The challenge title.
      rawPrompt - The raw prompt text.
      toolkits - The list of toolkit settings.
  • Method Details

    • getToolkitFqns

      public List<String> getToolkitFqns()
      Extracts the fully qualified class names (FQNs) or names of all configured toolkits for this test.
      Returns:
      List of toolkit names/FQNs or an empty list if using container defaults.
    • getResolvedToolPermissions

      public Map<String, ToolPermission> getResolvedToolPermissions(Class<?> concreteJavaClass)
      Aggregates and resolves all tool permission overrides configured across all toolkits.
      Parameters:
      concreteJavaClass - The resolved concrete class for Java tooling in the active container.
      Returns:
      A consolidated map of tool permission keys (e.g. "SwingJava.compileAndExecute") to their permissions.
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
    • testCode

      public String testCode()
      Returns the value of the testCode record component.
      Returns:
      the value of the testCode record component
    • title

      public String title()
      Returns the value of the title record component.
      Returns:
      the value of the title record component
    • rawPrompt

      public String rawPrompt()
      Returns the value of the rawPrompt record component.
      Returns:
      the value of the rawPrompt record component
    • toolkits

      public List<ToolkitSettings> toolkits()
      Returns the value of the toolkits record component.
      Returns:
      the value of the toolkits record component