Package io.micronaut.sourcegen.model
Class MethodDef.MethodDefBuilder
java.lang.Object
io.micronaut.sourcegen.model.AbstractElementBuilder<MethodDef.MethodDefBuilder>
io.micronaut.sourcegen.model.MethodDef.MethodDefBuilder
- Enclosing class:
- MethodDef
public static final class MethodDef.MethodDefBuilder
extends AbstractElementBuilder<MethodDef.MethodDefBuilder>
The method builder definition.
- Since:
- 1.0
- Author:
- Denis Stepanov
-
Field Summary
Fields inherited from class io.micronaut.sourcegen.model.AbstractElementBuilder
annotations, javadoc, modifiers, name, thisInstance
-
Method Summary
Modifier and TypeMethodDescriptionaddParameter
(ParameterDef parameterDef) addParameter
(String name, TypeDef type) addParameter
(String name, Class<?> type) addStatement
(StatementDef statement) addStatements
(Collection<StatementDef> newStatements) build()
build
(BiFunction<VariableDef.This, List<VariableDef.MethodParameter>, StatementDef> bodyBuilder) Mark the method as an override.overrides
(boolean overrides) Mark the method as an override.The return type of the method.Methods inherited from class io.micronaut.sourcegen.model.AbstractElementBuilder
addAnnotation, addAnnotation, addAnnotation, addAnnotation, addJavadoc, addModifiers
-
Method Details
-
returns
The return type of the method. In a case of missing return type it will be extracted from the statements.- Parameters:
type
- The return type- Returns:
- the current builder
-
overrides
Mark the method as an override.- Returns:
- the current builder
-
overrides
Mark the method as an override.- Parameters:
overrides
- The value- Returns:
- the current builder
-
returns
-
addParameter
-
addParameter
-
addParameter
-
addStatement
-
addStatements
-
build
-
build
public MethodDef build(BiFunction<VariableDef.This, List<VariableDef.MethodParameter>, StatementDef> bodyBuilder)
-