kotlinpoet / com.squareup.kotlinpoet / FunSpec

FunSpec

class FunSpec

A generated function declaration.

Types

Builder

class Builder

Properties

annotations

val annotations: List<AnnotationSpec>

body

val body: CodeBlock

delegateConstructor

val delegateConstructor: String?

delegateConstructorArguments

val delegateConstructorArguments: List<CodeBlock>

exceptions

val exceptions: List<TypeName>

isAccessor

val isAccessor: Boolean

isConstructor

val isConstructor: Boolean

kdoc

val kdoc: CodeBlock

modifiers

val modifiers: Set<KModifier>

name

val name: String

parameters

val parameters: List<ParameterSpec>

receiverType

val receiverType: TypeName?

returnType

val returnType: TypeName?

typeVariables

val typeVariables: List<TypeVariableName>

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

getterBuilder

fun getterBuilder(): 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.

setterBuilder

fun setterBuilder(): Builder