Record Class Location

java.lang.Object
java.lang.Record
com.tnsai.agents.validation.Location

public record Location(Optional<String> roleClass, Optional<String> capabilityInterface, Optional<String> actionName, Optional<String> toolName) extends Record
Where in the agent configuration a ValidationIssue originates.

Every field is optional because issues vary in granularity: a missing-LLM error is agent-wide (no Location fields populated), an action-name conflict is role + action-name scoped, a tool-confirmation gap is tool-name scoped. Operators get progressively narrower context as the validators detect deeper problems.

Since:
0.5.0 (issue #85)
  • Constructor Details

    • Location

      public Location(Optional<String> roleClass, Optional<String> capabilityInterface, Optional<String> actionName, Optional<String> toolName)
      Creates an instance of a Location record class.
      Parameters:
      roleClass - the value for the roleClass record component
      capabilityInterface - the value for the capabilityInterface record component
      actionName - the value for the actionName record component
      toolName - the value for the toolName record component
  • Method Details

    • agentWide

      public static Location agentWide()
      Empty location — agent-wide issue, not scoped to any single role / action.
    • role

      public static Location role(String className)
    • tool

      public static Location tool(String toolName)
    • action

      public static Location action(String roleClass, String actionName)
    • 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.
    • roleClass

      public Optional<String> roleClass()
      Returns the value of the roleClass record component.
      Returns:
      the value of the roleClass record component
    • capabilityInterface

      public Optional<String> capabilityInterface()
      Returns the value of the capabilityInterface record component.
      Returns:
      the value of the capabilityInterface record component
    • actionName

      public Optional<String> actionName()
      Returns the value of the actionName record component.
      Returns:
      the value of the actionName record component
    • toolName

      public Optional<String> toolName()
      Returns the value of the toolName record component.
      Returns:
      the value of the toolName record component