Record Class EnclosingScope
java.lang.Object
java.lang.Record
io.micronaut.sourcegen.bytecode.core.EnclosingScope
- Record Components:
member- The inner class being written, ornullfor no scopevariables- The variables of its enclosing class
@Internal
public record EnclosingScope(@Nullable ObjectDef member, List<TypeDef.TypeVariable> variables)
extends Record
The variables of the enclosing class in scope of the inner class a writer writes - a member class that is not
static - of the generated class the outer type names:
Supplier<T> of an inner class of an Outer<T>
names the T of Outer. A writer creates one for each class it writes and passes it with the definition
to the descriptors and signatures it asks for.- Since:
- 2.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final EnclosingScopeNo variables of an enclosing class: a top-level or static class, or a type described outside of a class being written. -
Constructor Summary
ConstructorsConstructorDescriptionEnclosingScope(@Nullable ObjectDef member, List<TypeDef.TypeVariable> variables) Creates an instance of aEnclosingScoperecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@Nullable ObjectDefmember()Returns the value of thememberrecord component.static EnclosingScopeof(ObjectDef objectDef, @Nullable ClassTypeDef outerType) The scope a definition is written in.final StringtoString()Returns a string representation of this record class.@Nullable TypeDef.TypeVariableA variable of the enclosing class in the scope of a definition.Returns the value of thevariablesrecord component.
-
Field Details
-
NONE
No variables of an enclosing class: a top-level or static class, or a type described outside of a class being written.
-
-
Constructor Details
-
Method Details
-
of
The scope a definition is written in.- Parameters:
objectDef- The definition being writtenouterType- The type enclosing it, if any- Returns:
- The scope,
NONEwhere the definition is not an inner class of a generated class
-
variable
A variable of the enclosing class in the scope of a definition.- Parameters:
objectDef- The definition whose scope it isname- The name of the variable- Returns:
- The variable, or
nullwhere the definition is not the inner class being written or its enclosing class declares none of the name
-
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). -
member
-
variables
-