Record Class PythonEnvironment
java.lang.Object
java.lang.Record
io.micronaut.python.processing.PythonEnvironment
- Record Components:
classes- A map of Python class names to their definitions.scripts- A map of Python script names to their definitions.decorators- A map of Python decorator names to their definitions.context- The GraalVM Polyglot context used for executing Python code.
- All Implemented Interfaces:
AutoCloseable
public record PythonEnvironment(Map<String,ClassDef> classes, Map<String, ScriptDef> scripts, Map<String, DecoratorDef> decorators, org.graalvm.polyglot.Context context)
extends Record
implements AutoCloseable
Represents a Python environment containing parsed Python classes, decorators, scripts, and the GraalVM Polyglot context.
This record holds the state of a Python module after parsing, providing access to class definitions, script definitions, and decorators.
- Since:
- 5.2.0
- Author:
- Micronaut
-
Constructor Summary
ConstructorsConstructorDescriptionPythonEnvironment(Map<String, ClassDef> classes, Map<String, ScriptDef> scripts, Map<String, DecoratorDef> decorators, org.graalvm.polyglot.Context context) Creates an instance of aPythonEnvironmentrecord class. -
Method Summary
Modifier and TypeMethodDescriptionclasses()Returns the value of theclassesrecord component.voidclose()org.graalvm.polyglot.Contextcontext()Returns the value of thecontextrecord component.Returns the value of thedecoratorsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.scripts()Returns the value of thescriptsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PythonEnvironment
public PythonEnvironment(Map<String, ClassDef> classes, Map<String, ScriptDef> scripts, Map<String, DecoratorDef> decorators, org.graalvm.polyglot.Context context) Creates an instance of aPythonEnvironmentrecord class.- Parameters:
classes- the value for theclassesrecord componentscripts- the value for thescriptsrecord componentdecorators- the value for thedecoratorsrecord componentcontext- the value for thecontextrecord component
-
-
Method Details
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
toString
-
hashCode
-
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). -
classes
-
scripts
-
decorators
Returns the value of thedecoratorsrecord component.- Returns:
- the value of the
decoratorsrecord component
-
context
-