Record Class AiMethodSuggestion

java.lang.Object
java.lang.Record
org.egothor.methodatlas.ai.AiMethodSuggestion
Record Components:
methodName - name of the analyzed test method as reported by the AI
securityRelevant - true if the AI classified the test as validating a security property
displayName - suggested @DisplayName value describing the security intent of the test; may be null
tags - taxonomy-based security tags suggested for the test method; may be empty or null depending on provider response
reason - explanatory rationale describing why the method was classified as security-relevant or why specific tags were assigned; may be null
confidence - AI confidence score in the range [0.0, 1.0] describing how certain the model is that the method is security-relevant; 0.0 when the AI did not provide a confidence score or when securityRelevant is false

public record AiMethodSuggestion(String methodName, boolean securityRelevant, String displayName, List<String> tags, String reason, double confidence) extends Record
Immutable AI-generated security classification result for a single test method.

This record represents the normalized method-level output returned by an AiSuggestionEngine after analyzing the source of a JUnit test class. Each instance describes the AI's interpretation of the security relevance and taxonomy classification of one test method.

The classification data contained in this record is typically produced by an external AI provider and normalized by the application's AI integration layer before being returned to the scanning logic. The resulting values are then merged with source-derived metadata during output generation.

The fields of this record correspond to the security analysis dimensions used by the MethodAtlasApp enrichment pipeline:

  • whether the test method validates a security property
  • a suggested @DisplayName describing the security intent
  • taxonomy-based security tags associated with the test
  • a short explanatory rationale describing the classification

Instances of this record are typically stored in a SuggestionLookup and retrieved using the method name as the lookup key when emitting enriched scan results.

See Also:
  • Constructor Details

    • AiMethodSuggestion

      public AiMethodSuggestion(String methodName, boolean securityRelevant, String displayName, List<String> tags, String reason, double confidence)
      Creates an instance of a AiMethodSuggestion record class.
      Parameters:
      methodName - the value for the methodName record component
      securityRelevant - the value for the securityRelevant record component
      displayName - the value for the displayName record component
      tags - the value for the tags record component
      reason - the value for the reason record component
      confidence - the value for the confidence record component
  • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • methodName

      public String methodName()
      Returns the value of the methodName record component.
      Returns:
      the value of the methodName record component
    • securityRelevant

      public boolean securityRelevant()
      Returns the value of the securityRelevant record component.
      Returns:
      the value of the securityRelevant record component
    • displayName

      public String displayName()
      Returns the value of the displayName record component.
      Returns:
      the value of the displayName record component
    • tags

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

      public String reason()
      Returns the value of the reason record component.
      Returns:
      the value of the reason record component
    • confidence

      public double confidence()
      Returns the value of the confidence record component.
      Returns:
      the value of the confidence record component