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 Summary
ConstructorsConstructorDescriptionScriptDef(String name, String packageName, List<FunctionDef> functions, List<AttributeDef> attributes, String documentation) Creates an instance of aScriptDefrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theattributesrecord component.Returns the value of thedocumentationrecord component.booleanIndicates whether some other object is "equal to" this one.Returns the value of thefunctionsrecord component.inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.Returns the value of thepackageNamerecord component.final StringtoString()Returns a string representation of this record class.withAttribute(AttributeDef attribute) withFunction(FunctionDef function) Methods inherited from interface ElementDef
decorators
-
Constructor Details
-
ScriptDef
public ScriptDef(String name, String packageName, List<FunctionDef> functions, List<AttributeDef> attributes, String documentation) Creates an instance of aScriptDefrecord class.- Parameters:
name- the value for thenamerecord componentpackageName- the value for thepackageNamerecord componentfunctions- the value for thefunctionsrecord componentattributes- the value for theattributesrecord componentdocumentation- the value for thedocumentationrecord component
-
ScriptDef
-
-
Method Details
-
withFunction
-
withAttribute
-
qualifiedName
-
equals
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 withObjects::equals(Object,Object). -
hashCode
-
toString
-
name
Returns the value of thenamerecord component.- Specified by:
namein interfaceElementDef- Returns:
- the value of the
namerecord component
-
packageName
Returns the value of thepackageNamerecord component.- Returns:
- the value of the
packageNamerecord component
-
functions
-
attributes
Returns the value of theattributesrecord component.- Returns:
- the value of the
attributesrecord component
-
documentation
Returns the value of thedocumentationrecord component.- Returns:
- the value of the
documentationrecord component
-