Class ParamSpec

java.lang.Object
com.tnsai.metadata.ParamSpec

public final class ParamSpec extends Object
Immutable metadata about a method parameter. Extracted from method signature and annotations via reflection. Following ADR-006: Immutable Models - Thread-safe by design - All fields final - No setters
  • Constructor Details

    • ParamSpec

      public ParamSpec(String name, Class<?> type, boolean optional, String defaultValue, String description, int position)
      Creates parameter metadata.
      Parameters:
      name - parameter name (from method signature)
      type - parameter type (from method signature)
      optional - whether parameter is optional (from @Optional annotation)
      defaultValue - default value if optional (from @Optional annotation)
      description - human-readable description (from @Description annotation)
      position - parameter position in method signature (0-based)
  • Method Details

    • getSimpleTypeName

      public String getSimpleTypeName()
      Gets the simple type name (without package).
      Returns:
      simple type name
    • getFullTypeName

      public String getFullTypeName()
      Gets the fully qualified type name.
      Returns:
      fully qualified type name
    • hasDescription

      public boolean hasDescription()
      Checks if this parameter has a description.
      Returns:
      true if description is not empty
    • hasDefaultValue

      public boolean hasDefaultValue()
      Checks if this parameter has a default value.
      Returns:
      true if default value is not empty
    • isPrimitive

      public boolean isPrimitive()
      Checks if the parameter type is primitive.
      Returns:
      true if type is primitive
    • isString

      public boolean isString()
      Checks if the parameter type is a String.
      Returns:
      true if type is String
    • isNumeric

      public boolean isNumeric()
      Checks if the parameter type is numeric (primitive or wrapper).
      Returns:
      true if type is numeric
    • toPromptString

      public String toPromptString()
      Creates a formatted string for prompt generation. Format: "name: type (optional) - description"
      Returns:
      formatted parameter string