Package io.micronaut.sourcegen.model
Interface VariableDef
- All Superinterfaces:
ExpressionDef
- All Known Implementing Classes:
VariableDef.Field
,VariableDef.Local
,VariableDef.MethodParameter
,VariableDef.StaticField
,VariableDef.This
public sealed interface VariableDef
extends ExpressionDef
permits VariableDef.Field, VariableDef.Local, VariableDef.MethodParameter, VariableDef.StaticField, VariableDef.This
The variable definition.
- Since:
- 1.0
- Author:
- Denis Stepanov
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final record
The variable of a field.static final record
The local variable.static final record
The variable of a method parameter.static final record
The variable of a static field.static final record
The variable of `this`.Nested classes/interfaces inherited from interface io.micronaut.sourcegen.model.ExpressionDef
ExpressionDef.CallInstanceMethod, ExpressionDef.CallStaticMethod, ExpressionDef.Condition, ExpressionDef.Constant, ExpressionDef.Convert, ExpressionDef.IfElse, ExpressionDef.NewArrayInitialized, ExpressionDef.NewArrayOfSize, ExpressionDef.NewInstance, ExpressionDef.Switch, ExpressionDef.SwitchYieldCase
-
Method Summary
Modifier and TypeMethodDescriptiondefault StatementDef
assign
(ExpressionDef expression) Assign this variable an expression.default StatementDef
assign
(ParameterDef parameterDef) Assign this variable a parameter value.Methods inherited from interface io.micronaut.sourcegen.model.ExpressionDef
asCondition, asConditionIf, asConditionIfElse, asConditionIfElse, asExpressionSwitch, asStatementSwitch, convert, field, field, invoke, invoke, invoke, invoke, invoke, isNonNull, isNull, newLocal, newLocal, returning, type, whileLoop
-
Method Details
-
assign
Assign this variable an expression.- Parameters:
expression
- The expression.- Returns:
- The statement
-
assign
Assign this variable a parameter value.- Parameters:
parameterDef
- The parameterDef.- Returns:
- The statement
-