kotlinpoet / com.squareup.kotlinpoet / FunSpec

FunSpec

class FunSpec

A generated function declaration.

Types

Builder class Builder

Properties

annotations val annotations: List<AnnotationSpec>
code val code: CodeBlock
defaultValue val defaultValue: CodeBlock?
exceptions val exceptions: List<TypeName>
isConstructor val isConstructor: Boolean
kdoc val kdoc: CodeBlock
modifiers val modifiers: Set<KModifier>
name val name: String
parameters val parameters: List<ParameterSpec>
returnType val returnType: TypeName?
typeVariables val typeVariables: List<TypeVariableName>
varargs val varargs: Boolean

Functions

equals fun equals(other: Any?): Boolean
hashCode fun hashCode(): Int
toBuilder fun toBuilder(): Builder
toString fun toString(): String

Companion Object Functions

builder fun builder(name: String): Builder
constructorBuilder fun constructorBuilder(): Builder
overriding fun overriding(method: ExecutableElement): Builder

Returns a new fun spec builder that overrides method.

fun overriding(method: ExecutableElement, enclosing: DeclaredType, types: Types): Builder

Returns a new function spec builder that overrides method as a member of enclosing. This will resolve type parameters: for example overriding Comparable.compareTo in a type that implements Comparable<Movie>, the T parameter will be resolved to Movie.