Package io.micronaut.sourcegen.model
Interface StatementDef
- All Known Implementing Classes:
ExpressionDef.CallInstanceMethod
,ExpressionDef.CallStaticMethod
,StatementDef.Assign
,StatementDef.DefineAndAssign
,StatementDef.If
,StatementDef.IfElse
,StatementDef.Multi
,StatementDef.Return
,StatementDef.Switch
,StatementDef.Throw
,StatementDef.While
public sealed interface StatementDef
permits ExpressionDef.CallInstanceMethod, ExpressionDef.CallStaticMethod, StatementDef.Assign, StatementDef.DefineAndAssign, StatementDef.If, StatementDef.IfElse, StatementDef.Multi, StatementDef.Return, StatementDef.Switch, StatementDef.Throw, StatementDef.While
The statement definition.
- Since:
- 1.0
- Author:
- Denis Stepanov
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final record
The assign statement.static final record
The local variable definition and assigment statement.static final record
The if statement.static final record
The if-else statement.static final record
The multi statement.static final record
The return statement.static final record
The switch statement.static final record
The throw statement.static final record
The while statement. -
Method Summary
Modifier and TypeMethodDescriptiondefault StatementDef
after
(StatementDef statement) The helper method to turn this statement into a multi statement.default List<StatementDef>
flatten()
Flatten the collection.static StatementDef
multi
(@NonNull StatementDef... statements) The multi line statement.static StatementDef
multi
(@NonNull List<StatementDef> statements) The multi line statement.
-
Method Details
-
after
The helper method to turn this statement into a multi statement.- Parameters:
statement
- statement- Returns:
- statement
- Since:
- 1.2
-
flatten
Flatten the collection.- Returns:
- all the statements
- Since:
- 1.2
-
multi
The multi line statement.- Parameters:
statements
- statements- Returns:
- statement
- Since:
- 1.2
-
multi
The multi line statement.- Parameters:
statements
- statements- Returns:
- statement
- Since:
- 1.2
-