Record Class ScriptDef

java.lang.Object
java.lang.Record
io.micronaut.python.processing.visitor.ScriptDef
Record Components:
name - The name of the script/module.
packageName - The package name of the script.
functions - The functions defined at module level.
attributes - The attributes defined at module level.
documentation - The script documentation string.
All Implemented Interfaces:
ElementDef

public record ScriptDef(String name, String packageName, List<FunctionDef> functions, List<AttributeDef> attributes, String documentation) extends Record implements ElementDef
A ScriptDef node represents a Python script/module definition. Scripts are module-level constructs that can have attributes (module variables) and functions (module-level functions).

ScriptDef(identifier name, list[FunctionDef] functions, list[AttributeDef] attributes)

  • Constructor Details

    • ScriptDef

      public ScriptDef(String name, String packageName, List<FunctionDef> functions, List<AttributeDef> attributes, String documentation)
      Creates an instance of a ScriptDef record class.
      Parameters:
      name - the value for the name record component
      packageName - the value for the packageName record component
      functions - the value for the functions record component
      attributes - the value for the attributes record component
      documentation - the value for the documentation record component
    • ScriptDef

      public ScriptDef(String name)
  • Method Details

    • withFunction

      public ScriptDef withFunction(FunctionDef function)
    • withAttribute

      public ScriptDef withAttribute(AttributeDef attribute)
    • qualifiedName

      public String qualifiedName()
    • 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
    • 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
    • name

      public String name()
      Returns the value of the name record component.
      Specified by:
      name in interface ElementDef
      Returns:
      the value of the name record component
    • packageName

      public String packageName()
      Returns the value of the packageName record component.
      Returns:
      the value of the packageName record component
    • functions

      public List<FunctionDef> functions()
      Returns the value of the functions record component.
      Returns:
      the value of the functions record component
    • attributes

      public List<AttributeDef> attributes()
      Returns the value of the attributes record component.
      Returns:
      the value of the attributes record component
    • documentation

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