Record Class NegativeExample

java.lang.Object
java.lang.Record
org.ek9lang.assist.NegativeExample
Record Components:
sourceFile - The relative path of the source .ek9 file
pattern - The error pattern name (e.g., "constrained-type-not-compatible")
category - The error category (e.g., "bad-generic-constraint-use")
corpus - The source corpus ("parseButFailCompile" or "fuzzCorpus")
purpose - Description of what this example demonstrates
whyItFails - Explanation of why the code fails to compile
errors - List of compiler errors this example triggers
howToFix - Suggested fixes for the error
validPatterns - Valid alternative patterns
keyConcepts - Key concepts demonstrated by this example
languageComparisons - How other languages handle this differently
strippedCode - Code body with all directive lines removed

public record NegativeExample(String sourceFile, String pattern, String category, String corpus, String purpose, String whyItFails, List<ErrorInfo> errors, List<String> howToFix, List<String> validPatterns, List<String> keyConcepts, List<LanguageComparison> languageComparisons, String strippedCode) extends Record
Holds a single negative training example from the EK9 test corpus. Negative examples teach LLMs what incorrect EK9 looks like, why it fails, and how to fix it. Sourced from parseButFailCompile and fuzzCorpus test files.
  • Constructor Details

  • Method Details

    • 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.
    • sourceFile

      public String sourceFile()
      Returns the value of the sourceFile record component.
      Returns:
      the value of the sourceFile record component
    • pattern

      public String pattern()
      Returns the value of the pattern record component.
      Returns:
      the value of the pattern record component
    • category

      public String category()
      Returns the value of the category record component.
      Returns:
      the value of the category record component
    • corpus

      public String corpus()
      Returns the value of the corpus record component.
      Returns:
      the value of the corpus record component
    • purpose

      public String purpose()
      Returns the value of the purpose record component.
      Returns:
      the value of the purpose record component
    • whyItFails

      public String whyItFails()
      Returns the value of the whyItFails record component.
      Returns:
      the value of the whyItFails record component
    • errors

      public List<ErrorInfo> errors()
      Returns the value of the errors record component.
      Returns:
      the value of the errors record component
    • howToFix

      public List<String> howToFix()
      Returns the value of the howToFix record component.
      Returns:
      the value of the howToFix record component
    • validPatterns

      public List<String> validPatterns()
      Returns the value of the validPatterns record component.
      Returns:
      the value of the validPatterns record component
    • keyConcepts

      public List<String> keyConcepts()
      Returns the value of the keyConcepts record component.
      Returns:
      the value of the keyConcepts record component
    • languageComparisons

      public List<LanguageComparison> languageComparisons()
      Returns the value of the languageComparisons record component.
      Returns:
      the value of the languageComparisons record component
    • strippedCode

      public String strippedCode()
      Returns the value of the strippedCode record component.
      Returns:
      the value of the strippedCode record component