Package io.micronaut.sourcegen.javapoet
Class MethodSpec
java.lang.Object
io.micronaut.sourcegen.javapoet.MethodSpec
A generated constructor or method declaration.
- 
Nested Class SummaryNested Classes
- 
Field SummaryFieldsModifier and TypeFieldDescriptionfinal List<AnnotationSpec>final CodeBlockstatic final Stringfinal AnnotationSpecfinal CodeBlockfinal CodeBlockfinal Stringfinal List<ParameterSpec>final TypeNamefinal List<TypeVariableName>final boolean
- 
Method SummaryModifier and TypeMethodDescriptionstatic MethodSpec.BuilderbooleaninthashCode()booleanhasModifier(Modifier modifier) booleanstatic MethodSpec.BuildermethodBuilder(String name) static MethodSpec.Builderoverriding(ExecutableElement method) Returns a new method spec builder that overridesmethod.static MethodSpec.Builderoverriding(ExecutableElement method, DeclaredType enclosing, Types types) Returns a new method spec builder that overridesmethodas a member ofenclosing.toString()
- 
Field Details- 
CONSTRUCTOR- See Also:
 
- 
name
- 
javadoc
- 
annotations
- 
modifiers
- 
typeVariables
- 
returnType
- 
parameters
- 
varargspublic final boolean varargs
- 
exceptions
- 
code
- 
defaultValue
- 
defaultAnnotationValue
 
- 
- 
Method Details- 
hasModifier
- 
isConstructorpublic boolean isConstructor()
- 
equals
- 
hashCodepublic int hashCode()
- 
toString
- 
methodBuilder
- 
constructorBuilder
- 
overridingReturns a new method spec builder that overridesmethod.This will copy its visibility modifiers, type parameters, return type, name, parameters, and throws declarations. An Overrideannotation will be added.Note that in JavaPoet 1.2 through 1.7 this method retained annotations from the method and parameters of the overridden method. Since JavaPoet 1.8 annotations must be added separately. 
- 
overridingpublic static MethodSpec.Builder overriding(ExecutableElement method, DeclaredType enclosing, Types types) Returns a new method spec builder that overridesmethodas a member ofenclosing. This will resolve type parameters: for example overridingComparable.compareTo(T)in a type that implementsComparable<Movie>, theTparameter will be resolved toMovie.This will copy its visibility modifiers, type parameters, return type, name, parameters, and throws declarations. An Overrideannotation will be added.Note that in JavaPoet 1.2 through 1.7 this method retained annotations from the method and parameters of the overridden method. Since JavaPoet 1.8 annotations must be added separately. 
- 
toBuilder
 
-