kotlinpoet / com.squareup.kotlinpoet / FunSpec / overriding

overriding

@JvmStatic fun overriding(method: ExecutableElement): FunSpec.Builder

Returns a new fun spec builder that overrides method.

This will copy its visibility modifiers, type parameters, return type, name, parameters, and throws declarations. An override modifier will be added.

@JvmStatic fun overriding(method: ExecutableElement, enclosing: DeclaredType, types: Types): FunSpec.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.

This will copy its visibility modifiers, type parameters, return type, name, parameters, and throws declarations. An override modifier will be added.