kotlinpoet / com.squareup.kotlinpoet / ParameterSpec

ParameterSpec

class ParameterSpec : Taggable

A generated parameter declaration.

Types

Builder

class Builder : Taggable.Builder<ParameterSpec.Builder>

Properties

annotations

val annotations: List<AnnotationSpec>

defaultValue

val defaultValue: CodeBlock?

kdoc

val kdoc: CodeBlock

modifiers

val modifiers: Set<KModifier>

name

val name: String

type

val type: TypeName

Functions

equals

fun equals(other: Any?): Boolean

hashCode

fun hashCode(): Int

toBuilder

fun toBuilder(name: String = this.name, type: TypeName = this.type): ParameterSpec.Builder

toString

fun toString(): String

Companion Object Functions

builder

fun builder(name: String, type: TypeName, vararg modifiers: KModifier): ParameterSpec.Builder
fun builder(name: String, type: Type, vararg modifiers: KModifier): ParameterSpec.Builder
fun builder(name: String, type: KClass<*>, vararg modifiers: KModifier): ParameterSpec.Builder

get

fun get(element: VariableElement): ParameterSpec

parametersOf

fun parametersOf(method: ExecutableElement): List<ParameterSpec>

unnamed

fun unnamed(type: KClass<*>): ParameterSpec
fun unnamed(type: Type): ParameterSpec
fun unnamed(type: TypeName): ParameterSpec

Extension Functions

tag

fun <T : Any> Taggable.tag(): T?

Returns the tag attached with T as a key, or null if no tag is attached with that key.