Record Class ArgumentsDef

java.lang.Object
java.lang.Record
io.micronaut.python.processing.visitor.ArgumentsDef
Record Components:
arguments - The list of function arguments.
declaringFunction - The function that declares these arguments.

public record ArgumentsDef(List<ArgumentDef> arguments, FunctionDef declaringFunction) extends Record
An ArgumentsDef represents the complete argument specification for a function.

This record contains all parameters of a Python function including their names, type annotations, and default values.

Since:
5.2.0
Author:
Micronaut Team
  • Constructor Details

    • ArgumentsDef

      public ArgumentsDef(List<ArgumentDef> arguments, FunctionDef declaringFunction)
      Creates an instance of a ArgumentsDef record class.
      Parameters:
      arguments - the value for the arguments record component
      declaringFunction - the value for the declaringFunction record component
  • Method Details

    • equals

      public 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.
    • hashCode

      public 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
    • empty

      public static ArgumentsDef empty()
      Creates an ArgumentsDef with an empty argument list.
      Returns:
      A new ArgumentsDef with no arguments
    • of

      public static ArgumentsDef of(List<ArgumentDef> arguments)
      Creates an ArgumentsDef from a list of arguments.
      Parameters:
      arguments - The argument list
      Returns:
      A new ArgumentsDef
    • of

      public static ArgumentsDef of(List<ArgumentDef> arguments, FunctionDef declaringFunction)
      Creates an ArgumentsDef from a list of arguments with a declaring function.
      Parameters:
      arguments - The argument list
      declaringFunction - The function that declares these arguments
      Returns:
      A new ArgumentsDef
    • of

      @Deprecated public static ArgumentsDef of(Object... arguments)
      Deprecated.
      Use of(List) instead
      Creates an ArgumentsDef from a list of arguments (backward compatibility).
      Parameters:
      arguments - The argument list
      Returns:
      A new ArgumentsDef
    • withDeclaringFunction

      public ArgumentsDef withDeclaringFunction(FunctionDef declaringFunction)
      Creates a new ArgumentsDef with the given declaring function.
      Parameters:
      declaringFunction - The function that declares these arguments
      Returns:
      A new ArgumentsDef with the declaring function set and propagated to arguments
    • 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
    • arguments

      public List<ArgumentDef> arguments()
      Returns the value of the arguments record component.
      Returns:
      the value of the arguments record component
    • declaringFunction

      public FunctionDef declaringFunction()
      Returns the value of the declaringFunction record component.
      Returns:
      the value of the declaringFunction record component